home *** CD-ROM | disk | FTP | other *** search
/ Risc World 3 / Risc World 3.iso / SOFTWARE / ISSUE6 / POWERBASE / OPRODOC / Manual (.txt) next >
Ovation Pro Document  |  2003-03-13  |  865KB  |  9,423 lines

  1. OvationPro
  2. (23-March-02)
  3. 1.1 to 20.102
  4. Generic
  5. Black
  6. White
  7. Transparent
  8. Green
  9. Magenta
  10. Yellow
  11. Registration
  12. RGB000000
  13. RGBFFFFFF
  14. rgb0/0/0
  15. rgb100/100/100
  16. Trinity.Medium.Italic
  17. Trinity.Bold.Italic
  18. Homerton.Bold
  19. Homerton.Bold.Oblique
  20. Homerton.Medium
  21. Trinity.Medium
  22. Trinity.Bold
  23. Corpus.Medium
  24. Corpus.Bold
  25. BodyText
  26. Main Heading
  27. Sub-Heading
  28. 1in indent
  29. Hanging indent
  30. Contents2
  31. Effect15300
  32. Effect17
  33. Sub-SubHeading
  34. Effect22
  35. Page number
  36. Corpus.Medium
  37. HalfSpace
  38. Effect663
  39. Centre
  40. Homerton.Medium
  41. NoGap
  42. SubSubSub
  43. Justify
  44. Contents0
  45. Contents1
  46. Trinity.Medium
  47. Effect946
  48. Effect13590
  49. Index
  50. Footnote
  51. Italic
  52. Index layout
  53. Effect12945
  54. Effect12948
  55. Underline
  56. Effect15296
  57. Effect13078
  58. Effect417
  59. Effect429
  60. Effect435
  61. Half space
  62. Effect16
  63. Effect21
  64. Hanging indent2
  65. Effect15309
  66. Effect15312
  67. Index headings
  68. on.Medium
  69. Table
  70. Table2
  71. W:?    \
  72. Ot 0'
  73. /I!x'
  74. I9#,(
  75. >b'@)
  76. :7,$+
  77. 1$-p+
  78. .n6 .
  79. s4/<$0
  80. OD<80
  81. +g<d0
  82. !MainDict
  83. !Ignore
  84. {filename} P
  85. {filename} P{pagenumber} {datetime}
  86. DrawPlus    
  87. Database for RISC OS computers
  88. with RISC OS 3.1 or later
  89.  Derek Haslam
  90. Revised January 2003 to comply with v. 9.14 of 
  91. Powerbase
  92. Contents
  93. Ch 1 
  94.  Introduction to Powerbase
  95. Description and installation
  96. 1.1.1
  97. Installation
  98. 1.1.2
  99. Tutorials
  100. 1.1.3
  101. Disclaimer
  102. Starting and ending a work session
  103. 1.2.1
  104. Loading Powerbase
  105. 1.2.2
  106. Opening a database
  107. 1.2.3
  108. Closing a database
  109. 1.2.4
  110. Quitting Powerbase
  111. Obtaining help
  112. 1.3.1
  113. Using the Acorn Help application
  114. 1.3.2
  115. Using the Helpreader text
  116. 1.3.3
  117. Emailing Powerbase Support and accessing our website
  118. Ch 2 
  119.  Browsing and Editing
  120. Subfiles, record numbers and keys
  121. 2.1.1
  122. Subfiles
  123. 2.1.2
  124. Record numbers
  125. 2.1.3
  126. Moving about the database
  127. 2.2.1
  128. Browsing
  129. 2.2.2
  130. Cross-referencing records
  131. 2.2.3
  132. Changing keys
  133. 2.2.4
  134. Changing subfiles
  135. 2.2.5
  136. Using more than one subfile
  137. 2.2.6
  138. Naming subfiles
  139. Searching for a record
  140. 2.3.1
  141. Searching by key
  142. 2.3.2
  143. Searching by record number
  144. 2.3.3
  145. Searching by filter
  146. Editing the database 
  147.  fundamental operations
  148. 2.4.1
  149. Adding new records
  150. 2.4.2
  151. Deleting records
  152. 2.4.3
  153. Altering existing records
  154. 2.4.4
  155. Undoing mistakes
  156. Editing the database 
  157.  special features
  158. 2.5.1
  159. Using a template
  160. 2.5.2
  161. Copying fields
  162. 2.5.3
  163. Copying an entire record
  164. 2.5.4
  165. Choosing the field where editing starts
  166. 2.5.5
  167. Changing many records at once
  168. 2.5.6
  169. Moving or deleting many records at once
  170. 2.5.7
  171. Hiding sensitive data
  172. 2.5.8
  173. Protecting data against deletion
  174. External fields
  175. 2.6.1
  176. Linking files to the fields
  177. 2.6.2
  178. Editing External fields
  179. 2.6.3
  180. Clearing and exporting field contents
  181. 2.6.4
  182. Editing scrollable lists
  183. Backing up
  184. Ch 3 
  185.  Printing from the Database
  186. Output destination
  187. 3.1.1
  188. The Window destination
  189. 3.1.2
  190. Reloading saved reports
  191. 3.1.3
  192. Calling up records from the report window
  193. 3.1.4
  194. The Text file destination 
  195. 3.1.5
  196. The Printer destination
  197. Print formats
  198. 3.2.1
  199. Horizontal
  200. 3.2.2
  201. Vertical   
  202. 3.2.3
  203. Table
  204. 3.2.4
  205. Label
  206. What types of field can be printed?
  207. Specifying which fields to print
  208. 3.4.1
  209. Saving print selection files
  210. 3.4.2
  211. Default selection
  212. Specifying which records to print
  213. 3.5.1
  214. The construction of search formulae
  215. 3.5.2
  216. Numeric and other special fields in search formulae
  217. 3.5.3
  218. Using 
  219. wild-cards
  220.  in search formulae
  221. 3.5.4
  222. Querying scrollable lists
  223. 3.5.5
  224. Comparing the contents of two fields
  225. 3.5.6
  226. Saving search formulae for re-use
  227. Query by example
  228. 3.6.1
  229. What is QBE?
  230. 3.6.2
  231. QBE vs QSF
  232. Other features of the Query panel and Match window
  233. 3.7.1
  234. Printing records from more than one subfile
  235. 3.7.2
  236. Including record number, key and subfile number
  237. Marking records for inclusion or exclusion
  238. 3.8.1
  239. Arbitrary selection of records
  240. 3.8.2
  241. Groups of records
  242. Printing only the displayed record
  243. The print options window
  244. 3.10.1 
  245. Scrollable lists
  246. 3.10.2 
  247. The rest of the print options
  248. 3.10.3 
  249. Saving print options files
  250. The printer setup window
  251. 3.11.1 
  252. Line length and point size of fonts
  253. 3.11.2 
  254. Print margins
  255. 3.11.3 
  256. Printing speed
  257. Field analysis reports
  258. Subsidiary indexes and printing speed
  259. Ch 4 
  260.  Creating a New Database
  261. Creating the database application shell
  262. Designing the record layout
  263. 4.2.1
  264. Simple field creation
  265. 4.2.2
  266. Deleting, inserting and re-ordering fields.
  267. 4.2.3
  268. Moving and re-sizing the bounding box
  269. 4.2.4
  270. More about tags and descriptors
  271. 4.2.5
  272. Other types of Editable field
  273. 4.2.6
  274. Scrollable lists
  275. 4.2.7
  276. Check-box fields
  277. 4.2.8
  278. External fields
  279. 4.2.9 
  280. Remote fields
  281. 4.2.10 
  282. Auto-displaying External files
  283. 4.2.11
  284. Computed fields
  285. 4.2.12 
  286. Stamp fields
  287. 4.2.13 
  288. Button fields
  289. 4.2.14 
  290. Mandatory fields
  291. A short-cut to a working database
  292. Specifying the database size
  293. Specifying the primary key
  294. 4.5.1
  295. General procedure
  296. 4.5.2
  297. Some illustrative examples
  298. 4.5.3
  299. Using more than one field in a key
  300. 4.5.4
  301. Further refinements
  302. 4.5.5
  303. Other matters concerning keys
  304. Building the empty database
  305. Renaming a database
  306. Ch 5 
  307.  Input Validation and Validation Tables
  308. Character validation
  309. Validation tables
  310. Creating a validation table
  311. Linking tables to fields
  312. 5.4.1
  313. The Replace on entry feature
  314. 5.4.2
  315. When to turn off the Exact match button
  316. 5.4.3
  317. Conditional validation
  318. Displaying validation tables
  319. The validation table menu
  320. Loading validation tables
  321. Including validation table data in printouts
  322. Entering validation table data into a record
  323. Ch 6 
  324.  Performing Calculations
  325. Calculated fields
  326. 6.1.1
  327. Simple calculations using Numeric fields
  328. 6.1.2
  329. Making calculations retrospective
  330. 6.1.3
  331. Calculations using non-numeric fields (!)
  332. 6.1.4
  333. Calculations involving times
  334. 6.1.5
  335. Calculations involving dates
  336. Composite fields
  337. User functions
  338. Calculations for reports only
  339. Calculations from an Evaluate button
  340. Calculations on a column of a report
  341. Ch 7 
  342.  Using extra indexes
  343. Indexing a field
  344. Automatic saving of indexes
  345. Ch 8 
  346.  Exporting and Importing data - CSV files
  347. What are CSV files?
  348. Setting the CSV options
  349. Exporting data as a CSV file
  350. 8.3.1
  351. Scrollable lists and CSV files
  352. Using CSV files to import data
  353. 8.4.1
  354. Ensuring that the correct options are selected
  355. 8.4.2
  356. Directing imported data to the correct fields
  357. 8.4.3
  358. Importing data from plain text files
  359. 8.4.4
  360. What if the imported data won
  361. t fit?
  362. Using CSV files to modify existing records
  363. Importing data into validation tables
  364. Creating a new, working database from a CSV file
  365. Other methods of exporting data
  366. Ch 9 
  367.  Mail-Merging with Impression, Ovation and Ovation Pro
  368. Mail-merging with Ovation*
  369. 9.1.1
  370. Preparing an Ovation document for mail-merging
  371. 9.1.2
  372. Merging the data from Powerbase
  373. Mail-merging with Impression and Ovation Pro
  374. 9.2.1
  375. Preparing the document for merging
  376. 9.2.2
  377. Merging the data
  378. Mail-merging with other programs
  379. Ch 10 
  380.  Utilities
  381. Changing the Primary Key
  382. Altering the record format
  383. Rebuilding the database
  384. Merging two databases
  385. Changing the Database Length
  386. Inspecting and balancing index trees
  387. Useful database details
  388. Finding duplicate primary keys
  389. 10.9 Libraries
  390. Ch 11 
  391.  Passwords and related matters
  392. Levels of protection
  393. 11.1.1 
  394. Individual I.D.s and passwords
  395. Options selected from the password-setting window
  396. 11.2.1 
  397. Duplicate primary keys
  398. Logging database changes
  399. Ch 12 
  400.  Script Files
  401. The !SCRIPT command
  402. 12.1.1 
  403. Filenames in script commands
  404. Commands used for reporting
  405. Setting print options
  406. Setting printer setup options
  407. Commands used mainly for editing
  408. Repeating operations using a loop
  409. Other commands
  410. Requesting user input from script files
  411. Ch 13 
  412.  Subset databases
  413. Creating a subset
  414. Using a subset to shorten a database
  415. Ch 14 
  416.  User choices
  417. Preferences
  418. 14.1.1 
  419. Control
  420. 14.1.2 
  421. Separators in date and time fields
  422. 14.1.3 
  423. Wild-cards
  424. 14.1.4 
  425. Option buttons
  426. 14.1.5 
  427. Save indexes (Default: Manual)
  428. 14.1.6 
  429. Start editing at
  430. 14.1.7 
  431. Application for ImpulseII data-merging
  432. 14.1.8 
  433. Save choices
  434. CSV options
  435. Print and Printer setup options
  436. Layout grid options
  437. Colours of key fields and table-linked fields
  438. Defining the function keys
  439. Overall control of the database
  440. Config files
  441. The Messages file
  442. 14.10 Giving a database a title screen
  443. 14.11 Saving and re-loading choices
  444. 14.11.1
  445. Where are choices 
  446. les saved?
  447. 14.11.2
  448. Priority of choices
  449. 14.11.3
  450. What does the Load default button do?
  451. 14.11.4
  452. Preserving your own choices when upgrading
  453. Ch 15 Customising Powerbase
  454. A demonstration
  455. How is it done?
  456. What happens when Powerbase is run?
  457. What happens when a database is opened?
  458. Creating buttons
  459. What goes inside the IF...THEN structure?
  460. Detecting events
  461. Appendix A 
  462.  Powerbase as an Impulse server
  463. Description:
  464. Appendix B 
  465.  Keystroke equivalents
  466. Index
  467. ED-    <
  468. Etr    <LA
  469. Ch 1 
  470.  Introduction to 
  471. Powerbase
  472. Description and installation
  473. Powerbase
  474.  is a database management system for use with  RISC OS computers. The information in this manual applies to 
  475. Powerbase v. 9.14,
  476.  of which
  477. there are two variants: 9.14DA
  478.  and 9.14SH. They differ only in their method of memory-mangement; 9.14DA uses dynamic areas and 9.14SH uses the sliding-heap module which has featured in 
  479. Powerbase
  480.  ever since it migrated to  RISC OS
  481.  from the BBC micro. 
  482. If you use RISC OS 3.1 you need v.9.14SH. 
  483. Please note that v.9.14DA is not compatible with RISC OS 3.1
  484. . For RISC OS 3.5 or above, however, v.9.14DA is recommended. You may use v.912SH if you prefer (objections have been voiced concerning programs which make extensive use of dynamic areas) and both versions have been tested on RISC OS v.3.5 to 4.33 and can exploit the Users feature of the latter when saving choices 
  485. les. The sliding-heap module used in 9.14SH is now 32-bit compatible so there should be no problem using it on an Iyonix. 
  486. 1.1.1
  487. Installation
  488. You may receive 
  489. Powerbase
  490.  and its accompanying documentation and sample databases in compressed form as a set of zip files.  These need to be unzipped (de-archived) before you can use them. The following procedure is suggested:
  491. On your hard disc create a new directory called Powerbase and open it.
  492. Run the copy of  
  493. !SparkPlug
  494.  supplied on the distribution disc.
  495. Double click on one of the files you wish to unzip. A window will open showing the contents of the file.
  496. Select all the objects in the window and drag them to your newly-created Powerbase directory.
  497. Repeat steps (c) and (d) until you have 
  498. de-archived
  499.  all the material you require.
  500. 1.1.2
  501. Tutorials
  502. Two tutorials are provided in a separate booklet. If databases are completely new to you we recommend you to work thought the 
  503. Quick Tutorial
  504. which is based on the simple address-book database 
  505. !Friends.
  506.   If you are somewhat more experienced but are using 
  507. Powerbase
  508.  for the first time you will probably find 
  509. Tutorial
  510. , using the 
  511. !Elements
  512.  database, more appropriate. 
  513. 1.1.3
  514. Disclaimer
  515. No warranty, express or implied, is made about the suitability of 
  516. Powerbase 
  517. for any purpose. We cannot be held responsible for any loss or damage  due to the use of this software.  All enquiries, requests for upgrades etc, should be directed to:
  518. Powerbase Support
  519. 112, Keighley Road
  520. Colne
  521. Lancashire
  522. BB8 0PH
  523. (01282) 866835
  524. email
  525. quercus@ukgateway.net
  526. website
  527. www.pendle.ukgateway.net/
  528. When requesting an upgrade by post please enclose four first-class stamps to cover cost of disc and postage.
  529. Starting and ending a work session
  530. 1.2.1
  531. Loading 
  532. Powerbase
  533. Double-click on the 
  534. Powerbase
  535.  icon in a directory window and the program will load and place its icon on the iconbar.  The words 
  536. No data
  537.  will appear under the icon indicating that no database is open yet.
  538. 1.2.2
  539. Opening a database
  540. A database may be opened for use by either of the following methods:
  541. Dragging the database icon onto the 
  542. Powerbase 
  543. icon on the iconbar.  
  544. Double-clicking on the database icon.  This is the more usual method and may be used even if 
  545. Powerbase
  546.  is not already loaded, as long as it has been 
  547.  by the filer.
  548. What happens next depends on whether the database is 
  549. password
  550.  protected or not.  If no 
  551. password
  552. s have been defined (as is the case with all the sample databases on the distribution disc) the main record window will open and the name of the database will appear under the 
  553. Powerbase
  554.  icon.
  555. password
  556. -protected database will display the Access window in the middle of the screen requesting you to enter a 
  557. password
  558.  and perhaps even a personal user I.D. as well.  The window has an 
  559.  button which should be clicked with SELECT when you have entered the required information.  There is also a 
  560. Cancel
  561.  button which removes the window from the screen without further action.  Passwords and I.D.s are case-sensitive and, if incorrectly entered, result in either a 
  562. Password not known
  563. Access denied
  564.  message.  After three successive incorrect entries 
  565. Powerbase
  566.  will close down and remove itself from the iconbar.
  567. 1.2.3
  568. Closing a database
  569. There are three ways of closing a database:
  570. Open another database, either by double-clicking or dragging to the 
  571. Powerbase
  572.  icon. 
  573. Choose 
  574.  from 
  575. Powerbase's
  576.  iconbar menu. This also quits 
  577. Powerbase
  578.  itself.
  579. Choose 
  580. Close database
  581.  from the iconbar menu.  This still leaves the 
  582. Powerbase
  583.  application running.  The wording underneath reverts to 
  584. No data
  585. If you have made any change to the database while it was open the disc will be automatically updated so that your changes are not lost, whichever method of closure is used.
  586. 1.2.4
  587. Quitting 
  588. Powerbase
  589. Choose 
  590.  from the iconbar menu. You need not specifically close your database first; any changes made to it will be saved before 
  591. Powerbase
  592.  quits.
  593. Obtaining help
  594. 1.3.1
  595. Using the Acorn 
  596.  application
  597. When you are first becoming acquainted with 
  598. Powerbase
  599.  you may find it useful to load Acorn
  600.  application. 
  601. Powerbase
  602.  iconbar Information window and main menu Sub
  603. le control window each have a blue button (like the familiar tourist information sign) which will launch the 
  604.  application for you. Resize the Help window, if you wish, and move it to some convenient place on the screen. Moving the mouse pointer over the various windows, icons and many of the menus displayed by 
  605. Powerbase
  606.  will then give a brief description of the purpose of each.
  607. 1.3.2
  608. Using the 
  609. Helpreader
  610.  text
  611. Further help is available from the 
  612.  option which appears on both the main menu and the iconbar menu. Choosing this option displays a text file which you can 
  613. navigate
  614.  by means of small orange buttons included in the text. Clicking with SELECT on such a button takes you directly to the part of the text referred to. Double-clicking with ADJUST takes you back to where you were when you last clicked on a button.
  615. Clicking MENU over the text window displays a menu giving an alternative means of access to specific parts of the text. The text has deliberately been kept fairly short and is in no way a substitute for this manual; it is intended to provide basic information only.
  616. 1.3.3
  617. Emailing Powerbase Support
  618.  and accessing our 
  619. website
  620. The iconbar Information window has buttons called 
  621.  and 
  622. Email.
  623.  Provided that the filer has 
  624.  your browser, clicking on the 
  625.  button will load it (if it
  626. s not already loaded) and insert the correct URL for our website from which you can download the latest version of 
  627. Powerbase
  628. , its documentation, and a set of sample databases and script files.  Similarly, if the filer has seen your mail program, clicking on the 
  629. Email
  630.  button will bring up a blank email with the correct email address for Powerbase Support.
  631. e-cli
  632. 0H}    -
  633. There is one circumstance where this is not possible and that is when you are running a database from the 
  634. RAM disc
  635. . Switching off the computer or quitting the 
  636. RAM disc
  637.  will, of course, result in loss of data. When you close a database on the 
  638. RAM disc
  639.  therefore,  
  640. Powerbase
  641.  will warn you to back it up to a more permanent medium.
  642.  Thanks are due to Ben Summers who wrote the 
  643. Helpreader 
  644. application used to create and display this text file and who kindly gave permission for it to be distributed with 
  645. Powerbase
  646. Ch 2 
  647.  Browsing and Editing
  648. Opening a database displays the 
  649. record window
  650. which shows the data for one 
  651. record 
  652. at a time. Each item of data in the record occupies a rectangle called a 
  653. field
  654. Most (but not all) fields will have a 
  655. descriptor
  656.  or label which appears next to the field. In addition 
  657.  data fields will have a 
  658.  of up to four characters. Tags are very important (far more so than descriptors) as a means of identifying fields (see 
  659. 4.2.4
  660. ). If you click MENU over a field its tag is displayed in the menu, e.g. Field: NAME.
  661. Subfiles, record numbers and keys
  662. Look at the 
  663. title-bar
  664.  of the record window. Three pieces of information are displayed; the 
  665. subfile number
  666. , the 
  667. record number
  668.  and the 
  669. of the record.  Since we will make frequent reference to these terms it will be as well to explain each one at the outset.
  670. 2.1.1
  671. Subfile
  672. Suppose you have a bookshelf, capable of holding 100 books, and six partitions, numbered 0
  673. 5, which you can use to divide it into sections.  The partitions are, to begin with, all stacked together at the left-hand end of the shelf. You may leave them like this if you wish and fill up the shelf with an unbroken run of 100 books. If, however, the books fall into well defined categories you might prefer to use the partitions to divide the shelf up into sections. There are no restrictions on where you can place the partitions, or how many books you put into each section, as long as you don
  674. t exceed the total of 100 books.
  675. In a similar way every 
  676. Powerbase
  677.  database is able to use up to six subfiles numbered 0-5. When you open the database you are looking at subfile 0 and you might have no occasion to bother with the others at all, in which case they can be ignored. Like the bookshelf partitions subfiles are there for you to use or not use depending on what your requirements are.  The database remains the same size whether you use one subfile or all six and the number of records in a subfile is limited only by the defined size of the database. Unwanted sub
  678. les can, however, be disabled. To do so choose 
  679. le control
  680.  from the main menu. The window which opens has a button for each sub
  681. le and an associated menu button which allows them to be disabled and re-enabled. It is also possible from this menu to name sub
  682. les and to swap the positions of any two sub
  683. Section 
  684. 2.2.5 
  685. suggests instances in which you might find it advantageous to use several subfiles. 
  686. 2.1.2
  687. Record number
  688. Every record in the database has a number which specifies its position in a 
  689. file called 
  690. Database
  691. . As you step through the records (see 
  692. ) you will probably find that the record numbers shown in the title-bar look quite random.  Record numbers reflect the order in which records were originally entered into the database, not the 
  693. order
  694.  in which you see them while browsing. The latter is determined by the 
  695. 2.1.3
  696. A key is a group of letters or other characters derived from one or more of the data fields in a record and used to identify that record. A record is, of course, uniquely identified by its record number but record numbers are of limited use because they only reflect the order in which the records were entered.  Keys, on the other hand, are derived from the actual data and are stored in a special table called an 
  697. index
  698. .  The keys in the 
  699. index
  700.  are 
  701. ordered
  702. , either alphabetically or numerically and can therefore be used to examine the records in an order which is related to the data.  To use the bookshelf analogy again, you can specify a book as 
  703. the 15th from the left
  704.  (which is equivalent to using the record number) but specifying it by title, author or subject is much more useful. A key enables us to do the same for database records.
  705. A database may have several indexes built from keys based on different fields in the record but there 
  706.  be at least one which we call the 
  707. primary key
  708.  index
  709. . When you come to create a database of your own you will find that 
  710. Powerbase
  711.  insists that you define the 
  712. primary key
  713.  before you can use the database.
  714.  Subsidiary keys
  715.  may be defined at any time; whether you use them or not is up to you. 
  716. Look at the 
  717. field
  718.  and at the key itself in the title-bar and you will see that the two are related. You can recognize the key field for the currently-active key by its 
  719. descriptor
  720. (label) which will be red.
  721.  Key fields for unselected keys have 
  722. blue descriptors
  723. . Non-key fields have black descriptors. 
  724. primary key
  725.  field is further identified by the background colour of the data icon which is pale yellow instead of white like the other data fields.
  726. Moving about the database
  727. Attached to the left-hand edge of the record window is the 
  728. tool-pane
  729. which contains buttons for moving around the database, adding and deleting records, searching for records etc. (An alternative way of presenting these buttons 
  730.  the 
  731. keypad
  732. is described in  
  733. 14.1.1
  734. . It is also possible to place some or all of the buttons on the record window itself and use neither tool-pane nor keypad. 
  735. 4.2.13
  736.  explains how to do this and the sample database 
  737. Boxes
  738.  shows such buttons in use.)
  739. Most of the buttons have 
  740. keystroke equivalents
  741.  provided by the numbered 
  742. function keys
  743. F11) and experienced users might want to use these instead of the mouse. The relevant keystrokes are given in the text where appropriate but note that these are default values and may be redefined if so desired. Many other actions have equivalent Ctrl sequences which can
  744. t be redefined.  See 
  745. Appendix B 
  746. for a full list.
  747. 2.2.1
  748. Browsing
  749. At the top-left of the tool-pane is the 
  750. single-step 
  751. button
  752.  This, when clicked with SELECT, steps forward through the records one at a time. Clicking with ADJUST steps back one at a time. The keystroke equivalents for these two actions are 
  753. respectively. Beneath the single-step button is what we might call the 
  754. fast forward/rewind 
  755. button
  756. : it steps through the records in jumps of 10, using SELECT and ADJUST in the way just described. (Keys: 
  757. Shift F2/F1
  758. ). You can alter the number of records jumped by entering a different number in the writable icon to the right of the button. At top-right is the 
  759. ends 
  760. button
  761. : SELECT displays the final record, ADJUST displays the first record (
  762. Ctrl F2/F1
  763. The terms 
  764. forward
  765. final
  766.  and 
  767. first
  768.  in the preceding description refer to the order of records as determined by the 
  769.  in the 
  770. index
  771. . The file 
  772. wraps around
  773.  so after the final record, SELECT-clicking the single-step button takes you to the first record. If you display the first record, ADJUST-clicking the single-step button displays the final record. 
  774. The buttons on the 3rd row resemble the 
  775. stop 
  776. button
  777. s of a CD player or VCR and it will be convenient to refer to them by these names. 
  778. Play (F11
  779. ) causes 
  780. Powerbase
  781.  to run through the records, displaying each one briefly, and 
  782. stop (Shift F11
  783. ) halts the process. Closing the record window has the same effect as 
  784.  and so does the 
  785. Escape
  786.  key.  If 
  787. play 
  788. is clicked with SELECT records are displayed in forward order.  Using ADJUST displays them in reverse order. You may swap the order at any time by a further click on 
  789. . The time for which each record remains on screen may be altered by changing the 
  790. Fast forward interval
  791.  (see above); the larger number you type into this icon the longer each record will remain on screen.  
  792. At the bottom of the tool-pane are four 
  793. bookmarks
  794.  which let you mark specific records for rapid retrieval. Click on one with SELECT  and the number of the current record appears in the icon.  Clicking with SELECT on a bookmark icon which contains a record number will return you to that record.  Click with ADJUST to clear the marker.
  795. 2.2.2
  796. Cross-referencing records
  797. If you Shift/double-click on a field with SELECT, and the contents of the field match the current key of another record, that record will be displayed. The same is true if the field contains a record number preceded by a # symbol. This is a very handy facility for jumping quickly between records which are related in some way. It will also work if a field contains a comma separated list of keys or record numbers. A Shift/double-click on any one of these keys takes you to the relevant record. You could experiment with this using the 
  798. Elements
  799.  database. Look up, say, SODIUM, enter in one of the 
  800. Notes
  801.  fields the primary keys of the other Group 1 metals, i.e. lith,pota,rubi,caes,fran  (case of letters is unimportant). You can now access the records of these elements from SODIUM
  802. s record.
  803. 2.2.3
  804. Changing keys
  805. Skip the next three rows for now and examine the one bearing a blue symbol resembling a key. It is used to cycle through the available 
  806. indexes
  807.  using either SELECT or ADJUST (for reverse order, as you might expect).
  808.  Shift F5/F4
  809.   have the same effect. Wrap-around again applies. If no 
  810. subsidiary indexes
  811.  have been defined the button will have no effect.
  812. 2.2.4
  813. Changing subfiles
  814. Underneath the 
  815. key-change button
  816.  is one for changing the subfile being examined.  A newly-opened database always displays subfile 0. Clicking SELECT on the 
  817. subfile-change button
  818. ) causes subfile 1 to be accessed instead. Repeated clicks advance the subfile number by 1 until 5 is reached, after which 
  819. wrap-around
  820.  to subfile 0 occurs. ADJUST, as you might guess, accesses the subfiles in reverse order (
  821. ). Sub
  822. les which are disabled (see 
  823. 2.1.1
  824. ) are skipped over and cannot be accessed.
  825. 2.2.5
  826. Using more than one subfile
  827. Powerbase
  828.  database consists, as stated earlier, of six 
  829. subfiles
  830.  numbered 0-5. You may use subfile 0 (which is the one used by default) and ignore the others if you wish, but there are occasions when users might find 
  831. multiple subfiles
  832.  very useful. If, for example, you are maintaining a set of pupil records in a school you could assign one subfile to each year. At the end of a school year the promotion of Year 1 pupils to Year 2, Year 2 to Year 3 etc. can be brought about very easily using the 
  833. Rotate sub
  834. feature
  835. . You will 
  836. nd the two action buttons for this on the window accessed from  
  837. le control
  838.  on the main menu
  839. It actually 
  840. renumbers
  841.  the 
  842. subfiles
  843.  so that (for 
  844. clockwise
  845.  rotation) subfile 0 becomes 1, 1 becomes 2 etc  and 5 becomes 0. Records which were previously in, for example, subfile 2 will then be found in subfile 3. In an 11-16 school this would put the leavers into subfile 0, from which they could later be removed. You will be asked to confirm that it
  846. s what you want before 
  847. Powerbase
  848.  proceeds. 
  849. A more common use of 
  850. subfiles
  851.  is to use subfile 0 to hold the in-use records and subfile 1 as a repository for records which you want out of the way but don
  852. t want to lose permanently. 
  853. Powerbase
  854.  is actually used in this way in a certain Further Education college where the applications file for a course is built up in subfile 0. On enrolment day records are updated to reflect students
  855.  subject choices and all the records for applicants who have not appeared are moved into subfile 1. The enrolled students in subfile 0 are then timetabled and class lists are printed. During the first week of the course there is a trickle of late enrolments which simply involve retrieving the required records from subfile 1 and reinstating them in subfile 0. 
  856. The facilities for moving records, singly or in batches, from one subfile to another are described in 
  857. 2.4.2 
  858. 2.5.6
  859. . You can, of course, also select a subfile and type new records directly into it.
  860. 2.2.6
  861. Naming subfiles
  862. To give subfiles meaningful names choose 
  863. le control
  864.  from the main menu
  865. . This opens a window with pop-up menus for each sub
  866.  then
  867.  leads to a writable menu item into which you may type a name of up to 20 characters which becomes the name of the relevant subfile and will be saved on closing the database.
  868. Searching
  869.  for a record
  870. s all very well being able to move about the database like flipping through the pages of a book but how do we find a specific record?  
  871. Powerbase
  872.  provides three ways of doing this: you can search for the record by 
  873. , by 
  874. record number
  875.  or by using a 
  876. filter
  877. 2.3.1
  878. Searching by key
  879. The button with the question mark is the 
  880. search
  881.  button
  882. ). When clicked with SELECT  the Search window opens to the right of the tool-pane. Type the key of the required record into the writable icon and click on the 
  883. Find 
  884. button
  885. or type Return. To see how the key is constructed from the 
  886. key field
  887.  click MENU over the 
  888. record window
  889.  and choose 
  890. Index => Show details 
  891. Ctrl K
  892. ). This displays a window describing the 
  893. key structure
  894.  of the currently-active index.
  895. If the key exists in the 
  896. index
  897.  the record will be found and displayed. If the key doesn
  898. t exist 
  899. Powerbase
  900.  beeps and displays the nearest matching record with the 
  901. key field
  902. flashing
  903. . If the database is a small one with 
  904.  which differ greatly from record to record then the displayed record may not look to be very near at all.  If you typed Return or used SELECT on the 
  905. Find 
  906. button the 
  907. Search window
  908.  will close after retrieving the record. If you want to search repeatedly it is more convenient to have the window stay on screen and this can be achieved by clicking on 
  909. Find 
  910. with ADJUST. If you do this you will notice that the icon above the 
  911. Find 
  912. button displays the number of 
  913. matches found
  914. Clicking on the 
  915.  icons (the up and down arrowheads) in the Search window allows you to search an index other than the current one. The index used affects the search only; clicking the browsing buttons on the tool-pane will show you that the current index has not been changed.
  916. A search carried out as described looks only at the current subfile. If you suspect that the record you require might be lurking in some other subfile you can force 
  917. all six to be searched
  918. . This can be achieved by using ADJUST (
  919. Shift F8
  920. ) instead of SELECT on the 
  921. search 
  922. button. When the 
  923. Search window
  924.  appears you will see that the 
  925. subfiles
  926.  radio button is selected instead of 
  927. This subfile
  928. . The radio buttons enable you to change your mind after the window has been opened.
  929. searching
  930.  on a numeric key you must enter a number of exactly the right value. If, however, the key is alphabetic you may use just the first few letters if they are sufficient to distinguish the key from others.
  931. There are two other buttons on the 
  932. Search window
  933. restores the last key entered into the writable icon and 
  934. Cancel 
  935. simply removes the window from the screen without further action.
  936. 2.3.2
  937. Searching by record number
  938. You may type a record number, preceded by # (e.g. #1054), in the Search window instead of a key. Provided the record is in use 
  939. Powerbase
  940.  will find and display it, regardless of which subfile it is in. Bear in mind that, if the record is found in some other subfile than the current one, that subfile will 
  941. become
  942.  the current one. If the record has been deleted or has never been assigned a 
  943. Record #xxx is not in use
  944.  message is displayed. 
  945. 2.3.3
  946. Searching by filter
  947. Filter
  948. button (
  949. Ctrl F8
  950. ) is just above the bookmarks on the tool-pane. Selecting it brings up the 
  951. Filter
  952.  window which contains a writable icon into which you can type a 
  953. search formula
  954.  (see 
  955. ).  You should then click on the 
  956. Filter
  957. button 
  958. in the 
  959. Filter
  960.  window
  961.  or, alternatively, type Return. The buttons used for browsing will now only display records which match the 
  962. search formula
  963. , all non-matching records being 
  964. filter
  965. ed out. Deselecting the 
  966. Filter
  967. button closes the Filter window and restores normal browsing operations.  So does clicking 
  968. Cancel
  969.  on the Filter window. The 
  970. Close
  971.  button simply closes the Filter window but leaves the filter in effect 
  972.  useful if you want the window out of the way once you
  973. ve set up a filter.
  974. Clicking on the single-step button with the filter window open and a filter active causes a displayed number to increment with every match found until the end of the subfile is reached. 
  975. Wrap-around
  976.  then occurs and the number no longer increases.  Clicking 
  977. Count
  978.  displays the total number of 
  979. matches in the subfile
  980.  straight away without the need to step through the records.
  981. Editing the database 
  982.  fundamental operations
  983. 2.4.1
  984. Adding new records
  985. The icon bearing a plus sign is the 
  986. add record
  987.  button
  988. ). Clicking with SELECT displays a blank record for you to fill in. The subfile number and anticipated record number are shown in the title-bar of the 
  989. record window
  990.  but there is, of course, no key as yet because there is no data. The title-bar therefore reads 
  991. (New)
  992.  in the place where the key would normally appear.  In most databases you may leave blank any fields except the primary key field.
  993. Powerbase
  994.  does, however, allow other fields to be defined as 
  995. mandatory fields
  996.  (see 
  997. 4.2.14
  998.  If the database contains such fields (which normally have red as their foreground colour) you will be told about them when you try to move to another record or close the database and will be unable to do so until you fill them in. You might also find that on some fields pressing certain keys has no effect. This will happen, for example, if you try to type letters into a field which has been defined as Numeric.
  999. Ctrl D
  1000.  will insert the current date into a field and 
  1001. Ctrl T
  1002.  will insert the time. The fields need not be designated as Date or Time fields for this to work (if so designated they will accept 
  1003.  the date or time) but the data will not be inserted if it is too long for the field.
  1004. If you type into a field whose text and border are dark green you may get an error message. These fields only accept certain values which are listed in a 
  1005. validation table
  1006.  (see 
  1007. ). To see what these values are make sure the caret is in the relevant field then click on the 
  1008. Table
  1009.  button
  1010.  on the tool-pane.
  1011.  There are times when this data-validation feature can become a nuisance, so it can be turned off. Bring up Powerbase
  1012. s iconbar menu and choose Preferences. One of the option buttons on the left of the preferences window is called Validate input. Deselect this button and click on Accept. All validation, including insistence on filling in mandatory fields, will then be disabled. 
  1013. Ctrl F9
  1014.  can also be used to toggle validation on and off.
  1015. After entering data into a field you can go to the next field in sequence by typing either the Return or the down-arrow key
  1016. . To go back one field use the up-arrow key
  1017. . These 
  1018. arrow keys
  1019.  work in such a way that attempting to go beyond the last field of the record takes you to the first field and attempting to go back from the first field takes you to the last 
  1020.  our old friend 
  1021. wrap-around
  1022.  again. Typing Return on the last field of a record acts rather differently in that it writes the record to disc and brings up a new blank record for editing, i.e. it duplicates the action of the 
  1023. add record
  1024.  button
  1025.  on the tool-pane. You can also place the caret in any editable field by clicking with SELECT.
  1026. When you have entered as much of a record as you wish you can click 
  1027. add record
  1028.  again for another blank record. The record you have just entered is automatically written to the database. The same is true if you click on any other tool-pane button or close the database altogether. You don
  1029. t need to use the 
  1030. Update
  1031. ) button to tell 
  1032. Powerbase 
  1033. to write the record 
  1034.  its real purpose is to make 
  1035. Powerbase
  1036.  save 
  1037. indexes
  1038.  and 
  1039. validation tables
  1040.  which are stored in memory. Occasional use of the button during a long working session guards against power cuts or system failure.
  1041. 2.4.2
  1042. Deleting records
  1043. The two buttons below the 
  1044. search
  1045.  and 
  1046. buttons are concerned with record deletion. The second of these, which suggests putting an index card in a dustbin, is obviously a 
  1047. delete 
  1048. button
  1049. Ctrl F10
  1050. ) but what about the other? A click with SELECT (
  1051. ) moves the displayed record forward, normally  by one subfile, e.g. if the record is in subfile 0 it will be moved to subfile 1.  If it is in subfile 5 it will be moved into subfile 0 (
  1052. wrap-around
  1053.  again).  
  1054. Clicking with ADJUST (
  1055. ) normally moves the record back one subfile. 
  1056. A record in subfile 5 will be moved into subfile 0. Normal behaviour is modi
  1057. ed, however, if sub
  1058. les have been disabled (see 
  1059. 2.1.1
  1060. ). The record is then moved to the next (or previous) 
  1061. enabled
  1062. This button, which we will refer to as the 
  1063. move record
  1064.  button
  1065. , clearly doesn
  1066. t delete records at all, except in the sense 
  1067. delete 
  1068. from the current subfile
  1069. . We often want to get a record out of our way but keep open the option of bringing it back again and that
  1070. s where these buttons are really useful. If you have a lot of records in subfile 0 and want to do a clear-out you can use subfile 1 as a dumping-ground for the unwanted records. You
  1071. re not really deleting them: just removing them from the subfile you
  1072. re working in.  
  1073. It is sometimes useful when moving a record, to be able to 
  1074. follow
  1075.  it into its new subfile. You can do so by holding down Shift while you click on the 
  1076. move record
  1077.  button. e.g. If you use Shift-SELECT to move a record from subfile 0 to 1 you will be left with 1 as the current subfile and the record displayed.
  1078. delete 
  1079. (dustbin) button should only be used when you are sure you want to lose the record permanently.  As this is quite a drastic action 
  1080. Powerbase 
  1081. will ask you to confirm it before the record actually disappears. Nervous users may prefer to leave this button strictly alone and do all their 
  1082. deleting
  1083.  with 
  1084. move record
  1085. .  If this eventually results in a lot of clutter in the subfile next to the one you
  1086. re using you can always do an occasional clear-out as described in 
  1087. 2.5.6
  1088. 2.4.3
  1089. Altering existing records
  1090. A displayed record may be altered manually without any restrictions other than those applying to the addition of new records (see 
  1091. 2.4.1
  1092. ). Alterations which would result in a change to the 
  1093. primary key
  1094.  must be confirmed. Normal RISC OS conventions for editing writable icons apply, e.g. 
  1095. Ctrl U
  1096.  clears the icon. As with new record entries you need do nothing to save your changes to disc. The process takes place automatically before a different record is displayed, when a database is closed or on quitting 
  1097. Powerbase
  1098. 2.4.4
  1099. Undoing mistakes
  1100. Changes to the record on-screen can be undone provided you haven
  1101. t clicked on 
  1102. Update
  1103.  (not normally needed anyway) or done anything to cause 
  1104. Powerbase
  1105.  to display a different record. In other words, you can 
  1106. undo changes
  1107.  made to the current record as long as it remains on the screen. You may either 
  1108.  the alterations made to the record or only those relating to specific fields.
  1109. If you bring up the 
  1110. main 
  1111. menu and choose 
  1112.  changes
  1113.  the record will be returned to the state it was in when you displayed it and before you began to edit it. To restore an individual field, click MENU over the field then go to the 
  1114. Field
  1115.  submenu and choose 
  1116.  changes
  1117.  from there. Only ordinary writable fields and check-boxes may be restored; you can
  1118. t restore 
  1119. External field
  1120. s (see 
  1121. ) which is why a warning is normally issued before deleting such fields.
  1122. Editing the database 
  1123.  special features
  1124. Section 
  1125.  described all the editing facilities you actually need in order to maintain your database. The features described in this section are not essential but they can save you time and make your use of the database more efficient.
  1126. 2.5.1
  1127. Using a template
  1128. You may want certain fields to be filled in with fixed contents on every new record to save typing the same thing every time and 
  1129. Powerbase
  1130.  provides a means of doing this. Call up the main menu, go to the 
  1131. Miscellaneous 
  1132. submenu and choose 
  1133. Edit template 
  1134. Ctrl E
  1135. ). A blank record is displayed and the window title says 
  1136. Enter data which you wish to appear by default on new records
  1137. . Type in the required 
  1138. fixed data
  1139.  then click any of the usual tool-pane buttons. You will now find that the new record displayed every time you click 
  1140. add record
  1141.  is no longer blank but already contains the data entered in your template. This feature affects 
  1142. records only; it doesn
  1143. t have a retrospective effect on existing records.
  1144. 2.5.2
  1145. Copying fields
  1146. The two buttons above the 
  1147. Update
  1148.  button may be thought of as 
  1149. copy 
  1150. to clipboard
  1151. Ctrl C
  1152. ) and 
  1153. paste
  1154.  from clipboard
  1155. Ctrl V
  1156. ) respectively. They can save a lot of time when you want to copy data from one field into another. When you click SELECT on 
  1157. the contents of the field which owns the caret is stored in memory. Positioning the caret in another field and clicking on 
  1158. paste 
  1159. will copy the stored data into the new field, erasing the field
  1160. s previous contents (if any). If the data is too long for the field it will be truncated. If there is nothing on the clipboard the data from the 
  1161. same field in the previously-displayed record
  1162.  will be copied to the field. 
  1163. copy 
  1164. paste
  1165. are not limited to copying into another field of the same record; you may use them to copy data between records or from a record into a 
  1166. validation table
  1167.  or a dialogue box or, indeed, between any two writable icons within 
  1168. Powerbase
  1169. . Data remains on the 
  1170. clipboard
  1171.  until you use 
  1172. copy 
  1173. again.
  1174. Even more conveniently data can be copied by simply dragging with SELECT. If you place the pointer over a field and hold down SELECT, a text-file icon appears under the pointer. This may be dragged and dropped into another field (provided it is an editable field) or into a writable icon in a dialogue box. It can even be dragged to another database if you have two copies of 
  1175. Powerbase
  1176.  running at once with two databases open. (The field contents may also be dragged to a different application such as a wordprocessor, or to a filer window where it will be saved as a file named from the field
  1177. . See also 
  1178. This is a suitable place to explain how 
  1179. Powerbase
  1180.  can also copy data to and from other applications by means of the 
  1181. global clipboard
  1182. . The latter is a feature of RISC OS which few users seem to know about and not all applications use it. Here
  1183. s how it works. Highlight one or more fields with ADJUST as described above and make sure the caret is in the displayed record. It needn
  1184. t be in one of the highlighted fields; any field will do. Now type 
  1185. Ctrl Shift C
  1186. . Nothing appears to have happened but the highlighted data is now on the global clipboard. If you open, say, an 
  1187. Impression
  1188.  window, place the caret in it and type 
  1189. Ctrl V
  1190.  the data will be copied to 
  1191. Impression
  1192. If, on the other hand, you highlight data in 
  1193. Impression
  1194.  and type 
  1195. Ctrl C
  1196. , then place the caret in a 
  1197. Powerbase
  1198.  record and type 
  1199. Ctrl Shift V
  1200.  the data will be copied from 
  1201. Impression 
  1202. Powerbase
  1203. . The same method may be used to copy data from 
  1204. Powerbase
  1205. Writer, Easywriter 
  1206. Techwriter.  
  1207. StrongEd
  1208.  you need to type 
  1209. Ctrl Shift V
  1210. . Although copying in the reverse direction works fine with 
  1211. Impression
  1212.  it does not appear to work with these other applications. 
  1213.  doesn
  1214. t appear to support the global clipboard at all.
  1215. 2.5.3
  1216. Copying an entire record
  1217. When a new record contains much of the same information as an existing one you can save time by copying a whole record and editing the copy. Display the record you want to copy and then click the 
  1218. add record
  1219.  button with ADJUST instead of SELECT (
  1220. Shift F10
  1221. ).  No blank record appears when you do this; instead an exact copy of the current record is displayed and a message appears informing you of this.  
  1222. If you make no changes to the copy 
  1223. Powerbase
  1224.  will 
  1225.  add the new record to the database.  (It is assumed that no-one will ever want two absolutely identical records in the same database!)  Any alteration, however, leads to the record becoming part of the database.
  1226. 2.5.4
  1227. Choosing the field where editing starts
  1228. When an existing or blank record is displayed 
  1229. Powerbase
  1230.  places the caret in the first (i.e. lowest-numbered) writable field of the record. (This might not necessarily 
  1231. look 
  1232. like the first if the fields have been placed in out-of-sequence positions in the window.) When going through a database making changes to one or two fields somewhere in the middle of a large number of records it might be convenient to have the caret start in another 
  1233. eld. Click MENU over the field where you wish editing to start, go to the 
  1234. Field 
  1235. submenu and choose 
  1236. Start editing
  1237. . When a record is displayed the caret will be placed in the chosen field. The same procedure is used to restore the normal starting position. This result can also be achieved by placing the caret where you want and typing 
  1238. Ctrl @
  1239. 2.5.5
  1240. Changing many records at once
  1241. To alter a given field in a set of records point the mouse at the field and click MENU. Go to the 
  1242. Field 
  1243. submenu and choose 
  1244. Global changes
  1245. . In the first writable icon (
  1246. Replace
  1247. ) enter what you want changing and in the second (
  1248. ) enter what you want the first string changing to. In the third you may enter a 
  1249. search formula
  1250.  (see 
  1251. ) specifying which records are to be changed. Finally click on 
  1252. Change 
  1253. or type Return. You will be asked for confirmation before the changes are allowed to take place. Note the following:
  1254. Only records in the current subfile are affected.
  1255. Replacement only occurs if the new data will fit in the field.
  1256. Leaving 
  1257. Replace
  1258.  blank causes the target field to be replaced in any record which matches the 
  1259. search formula
  1260. , otherwise replacement occurs only where the existing field matches the 
  1261. Replace 
  1262. string.
  1263. Leaving 
  1264.  blank causes the target field to be 
  1265. blanked 
  1266. in records which match the 
  1267. search formula
  1268.  and in which the target field matches the 
  1269. Replace
  1270.  string.
  1271. Leaving the 
  1272. search formula
  1273.  blank causes replacement to occur in all records of the current subfile for which the target field matches the 
  1274. Replace
  1275.  string.
  1276. It should be apparent from the above that leaving both 
  1277. Replace
  1278. Search formula
  1279.  blank will place the 
  1280.  string in all records of the current subfile.
  1281. The characters 
  1282.  and 
  1283.  may be used as 
  1284. wild-card
  1285.  characters in the 
  1286. Replace
  1287.  and 
  1288.  strings.
  1289.  The first of these is used to represent a group of characters which don
  1290. t need to be matched.  If you enter:
  1291. Replace 
  1292. $Street
  1293. with 
  1294. $Road
  1295. the substitution will be performed on any record which matches the 
  1296. search formula
  1297.  and where the target field 
  1298.  with 
  1299. Street
  1300. . The ending will be changed to 
  1301.  leaving the rest of the string unchanged.  Another example of use is:
  1302. Replace 
  1303. with 
  1304. 1047$
  1305. If the target field 
  1306. begins 
  1307. with 
  1308. , the beginning will be changed to 
  1309. , the remainder left unaltered: 
  1310. Replace 
  1311. $MPUT$ 
  1312. with 
  1313. $NFUS$
  1314. would change 
  1315.  occurring 
  1316. anywhere
  1317.  in the target field into 
  1318. , e.g. 
  1319. COMPUTER
  1320.  would become 
  1321. CONFUSER
  1322. (!).  You may, of course, use 
  1323.  in the 
  1324. middle
  1325.  of a word:
  1326. Replace 
  1327. re$ment 
  1328. with 
  1329. dis$d
  1330. would cause a string in the target field beginning with 
  1331.  and ending with 
  1332.  to have its head and tail replaced with 
  1333.  and 
  1334. , leaving the middle unchanged. e.g. 
  1335. replacement
  1336.  would become 
  1337. displaced
  1338.  character is used to represent a 
  1339. single 
  1340. wild-card character and can replace individual letters in specific positions. The 
  1341. Replace 
  1342. with 
  1343. strings here must be the same length and should have 
  1344.  characters in the same positions. The characters in the remaining positions are the ones which get replaced, but only if they occur in the corresponding positions of the existing string. 
  1345. You may also use 
  1346. Global changes
  1347.  to perform  
  1348. simple calculations
  1349.  e.g. 
  1350.  will add 12 to the current value in the field on all the matching records. 
  1351. *5-13
  1352.  will multiply the current value by 5 and then subtract 13. It is operations like these which are most likely to produce values which won
  1353. t fit in the field, especially if floating-point numbers are involved. The operation isn
  1354. t limited to 
  1355. Numeric field
  1356. s, or even to other types of field consisting wholly of numerals; 
  1357. Powerbase
  1358.  will find the number embedded in an entry such as 
  1359. ABC45XYZ
  1360.  and the operation 
  1361.  would convert it to 
  1362. ABC57XYZ
  1363. It is also possible to change the case of letters in a field, without any other change to the data, by placing special strings in the 
  1364.  field. These strings are distinguished by being placed in square brackets:
  1365. Make all letters uppercase
  1366. Make all letters lowercase
  1367. Make first letter of 
  1368. field 
  1369. uppercase, the rest lowercase
  1370. [ULUL]
  1371. Make first letter of 
  1372. each word
  1373.  in field uppercase, the rest lowercase
  1374. 2.5.6
  1375. Moving or deleting many records at once
  1376. Choose 
  1377. Move/delete
  1378.  from the 
  1379. Miscellaneous 
  1380. submenu. This opens a window which gives you the choice of three types of operation:
  1381. Delete
  1382.  records
  1383.  from a designated subfile
  1384. Accumulate
  1385.  records from all subfiles into one designated subfile  
  1386.  records
  1387.  from one designated subfile to another
  1388. The default is to 
  1389. Move 
  1390. records from the current subfile to the next in sequence, but any source or destination subfile may be specified by clicking on the bump-icons. Type in a 
  1391. search formula
  1392.  (see 
  1393. ) and click the default action button or type Return. All matching records will be moved or deleted as specified. Operations  may be undone by clicking on the 
  1394. button, but only for the last operation carried out. 
  1395. 2.5.7
  1396. Hiding sensitive data
  1397. Your database might contain information which you don
  1398. t want just anyone to read. A field may be hidden in the following way:
  1399. From the iconbar 
  1400. Utilities
  1401.  submenu choose 
  1402. Alter format
  1403. . This puts 
  1404. Powerbase
  1405.  into 
  1406. design mode
  1407. . No data is displayed; just the empty fields over a blue grid.
  1408. Double-click with SELECT over the field you wish to hide.
  1409. In the Field design window select the option button 
  1410.  and click 
  1411. Update field
  1412. From the main menu choose 
  1413. Quit design
  1414. . This returns you to normal 
  1415. editing mode
  1416. The field you
  1417. ve just 
  1418. doctored
  1419.  will now have vanished. Typing 
  1420. Ctrl Shift F1 
  1421. makes it reappear, but with its text in mid-grey to show that there
  1422. s something special about it. 
  1423. Ctrl Shift F2 
  1424. will hide it again. Even if you close the database with the field visible it will always be hidden when the database is re-opened. The field can only be returned to normal using the procedure detailed above, deselecting the 
  1425.  button.
  1426. Whilst in the invisible state a field cannot be selected for printing (see 
  1427. ). ADJUST has no effect and you can
  1428. t sneak round the protection by using 
  1429. Ctrl A
  1430.  to select all fields or by choosing a range containing the hidden field (i.e. by clicking with SELECT on an earlier field then double-clicking with ADJUST on a later one).  Its tag doesn
  1431. t appear in the 
  1432. Field
  1433.  entry of the main menu when you click MENU in the relevant place, nor does the field appear in the field list produced by typing 
  1434. Ctrl F
  1435. . As soon as you reveal the data by typing 
  1436. Ctrl Shift F1
  1437.  it can be printed as normal.
  1438. If you intend to use this facility you are strongly urged to password-protect your database (see 
  1439. Ch 11
  1440. ).  Only a user with 
  1441. Manager
  1442.  access rights
  1443.  will then be able to use 
  1444. Ctrl Shift F1
  1445.  or access 
  1446. Alter format
  1447.  to remove the protection.  If you leave the database unprotected then anyone can use the key combinations and might easily discover  them by chance (or by reading this manual!).
  1448. 2.5.8
  1449. Protecting data against deletion
  1450. If you follow steps (a) and (b) above you will see beneath the 
  1451.  button another option button called 
  1452.  Selecting this button and returning to editing mode causes the field to be locked against alterations. The Return and arrow keys skip over the field and an attempt to place the caret in it directly results in a message telling the user the field is locked against changes.
  1453. External field
  1454. The data in 
  1455. External field
  1456. s (see 
  1457. 4.2.8
  1458. ) is not stored within the 
  1459. Database 
  1460.  but in separate files, one for each record. With the exception of 
  1461. Remote fields
  1462.  these files are stored inside the database
  1463. s application directory.  They may be Text, Sprite or 
  1464. Draw files
  1465.  and can be linked to buttons on the 
  1466. record window. 
  1467. Clicking on these buttons loads the External file into 
  1468. Paint
  1469.  provided that the relevant program has been 
  1470.  by the filer. (For 
  1471. Remote fields
  1472.  the file objects can be of any type whatsoever including applications and directories and clicking on the button performs the appropriate action, e.g. an application is run, a directory is opened, an Obey or BASIC file is executed, other files are loaded into the appropriate editor if the filer knows where it is.  Remote fields are discussed fully in 
  1473. It is also possible to link Text files to a 
  1474. Text block field
  1475.  which will actually display the text (with certain limitations) within a large icon. Sprites may be similarly displayed in a 
  1476. Picture field
  1477. 2.6.1
  1478. Linking files to the fields
  1479. To link a file with an 
  1480. External field
  1481.  drag the file
  1482. s icon onto the 
  1483. record window
  1484.  and drop it on the appropriate field. For example, if the record includes a field represented by a 
  1485. Text button
  1486. , i.e. one bearing a small version of the 
  1487. Edit 
  1488. icon, you may drop a 
  1489. Text file
  1490.  onto it. The button
  1491. s icon changes to the small version of the Text file icon to indicate that the file has been linked. Sprite and Draw files are linked in the same way and 
  1492. Powerbase
  1493.  will not allow the wrong type of file to be linked. A 
  1494. Text block
  1495.  field also may have a Text file dropped onto it.
  1496.  The text (or as much of it as will fit inside the icon) is then displayed on the 
  1497. record window
  1498. .  The formatting will not be the same as it is when you examine the text in 
  1499. ; lines are word-wrapped and centred within the display icon. (This is a feature of multi-line RISC OS text icons and is out of the control of 
  1500. Powerbase
  1501. .) You can
  1502. t edit the text directly but it is possible to export the file for editing (see below). 
  1503. Sprite file
  1504. s may be dropped onto and displayed in a Picture field. Any new file dropped onto an 
  1505. External field
  1506.  which is already linked to a file simply replaces the old file with the new. 
  1507. 2.6.2
  1508. Editing External fields
  1509. You can
  1510. t edit an 
  1511. External field
  1512.  directly, only via an appropriate editing program such as 
  1513. Paint 
  1514. . As long as the editor has been 
  1515.  by the filer clicking on the on-screen button with SELECT will load the file into the editor and display it. You can edit the file and re-save it without altering its name and it will remain associated with the same field of the record.  The contents of 
  1516. Text block
  1517.  and 
  1518. Picture
  1519.  fields are loaded into their editors by a double click.
  1520. 2.6.3
  1521. Clearing and exporting field contents
  1522. Clicking MENU over an 
  1523. External field
  1524.  makes available certain entries on the 
  1525. Field 
  1526. submenu which are shaded for other types of field. 
  1527. Remove external
  1528. lets you delete the linked file from the database application.
  1529.  As deleting a file is irreversible you would probably like to be warned when this is about to happen so the message 
  1530. Delete object? Are you sure?
  1531.  normally appears. Finally, 
  1532. Save contents
  1533.  on the 
  1534. Field 
  1535. submenu lets you 
  1536. export the linked file
  1537.  to a filer window or to another application. 
  1538. 2.6.4
  1539. Editing scrollable lists
  1540. Entering or altering data in a scrollable list is not very different from doing so in other types of field, but some keys do behave differently and there are extra keystrokes to access the special features of such lists.
  1541. Return 
  1542. moves the caret from cell to cell across the current row, then jumps to the start of the next row. When it reaches the last visible cell the list will scroll up a row if there are still rows to display. If the last cell of the list has been reached the caret moves to the next field or next record, just as it does for other types of editable field.
  1543. Shift-Up-arrow
  1544.  has the opposite effect to Return, i.e. it moves the caret to the previous cell.
  1545. Shift-Return
  1546.  behaves like Return until the last cell of the list is reached. It then adds a row to the list, moving the caret to the start of the new row. You may add as many rows as you wish and each record can have a different number of rows.
  1547. Insert
  1548.  with the caret anywhere in the list also adds a row to the end, but this time without scrolling the list or moving the caret.
  1549. Ctrl-Insert
  1550.  will insert a blank row in the middle of a list, just above the row containing the caret.
  1551. Shift-Insert
  1552.  is used to remove unwanted blank rows. This key-combination is quite safe: it always deletes the last row but only if  the row is blank. The choice of the Insert key in this and the following combination may seem strange, but Delete can
  1553. t be used because it already has a standard function in writable icons.
  1554. Ctrl-Shift-Insert
  1555.  will force the deletion of the row containing the caret with the loss of the data from that row. You aren
  1556. t very likely to use this accidentally. 
  1557. Neither Shift-Insert nor Ctrl-Shift-Insert will let you reduce the number of rows to fewer than the minimum the window can display: when the scroll-bar completely fills its slot this minimum has been reached.
  1558. Up and Down arrows 
  1559. move the caret vertically from cell to cell, staying in the same column. When at the top or bottom of the list wrap-around occurs instead of the caret moving to the previous or following field as it does for other field types.
  1560. Wiping a scrollable list
  1561. Click MENU over the list and go to the 
  1562. Field
  1563.  submenu. Choose 
  1564. Blank list
  1565. . You will be asked for confirmation before the data is deleted.
  1566. Data export and import
  1567. When MENU is clicked over a scrollable list two choices become available on the 
  1568. Field
  1569.  submenu in addition to 
  1570. Blank list
  1571.  noted above:
  1572. Save as list
  1573. saves the contents of the scrollable
  1574.  list as a plain text file. The contents of each cell of the list occupies a separate line and there is nothing in the file to indicate which items came from the same row and which came from different rows. If such a 
  1575. file is dropped onto a scrollable list
  1576.  the data will be imported cell by cell, working along each row to the end then moving to the next.
  1577. Save as CSV
  1578.  saves the list as a CSV file (see 
  1579. ) with each row of the list as a separate CSV record and each cell in the row as a CSV field. The characteristics of the file are determined by the CSV Options window just as they are for exporting data from ordinary fields.
  1580. If you drop such a CSV file onto a scrollable list field the result is somewhat different from the importing of a text list as described above because the data in the file is more structured; the row and column information of the field from which the data came has been retained. 
  1581. Suppose you have exported such a file from a 3-column scrollable list. If you drop the file onto a 2-column list the third item in each line of the file will be ignored: the destination field will contain what the first two columns of the source field contained. If, on the other hand, you drop the file onto a 4-column scrollable list the 4th column of the list will be left blank. 
  1582. Backing up
  1583. Clicking the 
  1584. Backup
  1585.  button on the tool-pane with SELECT will back up your database to a user-de
  1586. ned directory. If no directory has been speci
  1587. ed (or if you wish to change the backup options) click the button with ADJUST.  A window will open on which the desired backup directory should be dropped. Its pathname will then appear in the writable icon. You may choose to keep 1, 2 or 3 
  1588. generations
  1589.  of backup and 
  1590. Powerbase 
  1591. will move backed-up copies into subdirectories 
  1592. Older
  1593.  and 
  1594. Oldest 
  1595. where
  1596.  required. 
  1597. An option button may be selected to force automatic backing up whenever the database is closed. 
  1598. You can save these choices in the database or in 
  1599. Powerbase
  1600.  itself and an icon to the right of the pathname displays 
  1601.  to indicate where choices are stored. There is also a button which opens the backup directory for inspection. 
  1602. ackup
  1603. 0 k    -
  1604. 0 *    -
  1605. 0PK    -
  1606. *    -P@
  1607. Colours used to identify
  1608.  key fields
  1609.  are the default colours but it is possible for the user to change them (see 
  1610. The tool-pane
  1611. """"""
  1612. If the primary key is derived from two or more fields you needn
  1613. t fill in all of them provided the result isn
  1614. t a null key.
  1615. The characters used to represent single and multiple wild-card characters may be changed via the Preferences window (see 
  1616. 14.5.2
  1617. * If you drop a text file in the wrong place in the record window 
  1618. Powerbase
  1619. will think you want to treat the file as CSV file and import data from it (see 
  1620. CSV files
  1621. ) and the Import text file window will appear. This is rather startling but harmless enough as long as you don
  1622. t click on 
  1623. Import
  1624. !  Click on 
  1625. Cancel 
  1626. to get rid of the window. 
  1627. Unlinking objects from Remote, Run file and Directory button 
  1628. elds is also done this way (see 
  1629. 4.2.8
  1630.  and 
  1631. 4.2.13
  1632. Ch 3 
  1633.  Printing from the Database
  1634. This chapter describes how to print out selected data from a database, including the printing of individual records and of labels. Such a print-out is commonly referred to as a 
  1635. report
  1636. Output destination
  1637. Printed output may be displayed in a window, directed to a specified text file or sent straight to the printer.  Choosing 
  1638. Options
  1639.  from the 
  1640. Print
  1641.  submenu (keystroke equivalent 
  1642. Ctrl Print
  1643. ) displays the 
  1644. Print Options
  1645.  window and you will see at the top of the window three radio buttons, 
  1646. Window
  1647. Text file
  1648.  and 
  1649. Printer
  1650. , which let you select the 
  1651. output destination
  1652. . Descriptions of these options follow.
  1653. 3.1.1
  1654. Window destination
  1655. This is the default setting and, as its name suggests, it displays the completed report in its own window. Clicking with MENU over this window opens the Report
  1656. menu which offers five choices:
  1657. Save as text
  1658.  produces a 
  1659. Save box
  1660.  from which an icon may be dragged to a filer window or to any application which can accept a text file. The supplied pathname uses an appropriate leaf-name for the file and points to a directory called 
  1661. PrintJobs
  1662.  which is inside the database directory. Each database has its own 
  1663. PrintJobs
  1664. directory which can be opened by choosing 
  1665. Show jobs done
  1666. ) from the Print
  1667. submenu. This menu choice also has its own submenu listing the directory contents. To save files with the least bother simply click on 
  1668.  or type Return. You can, of course, delete the pathname (
  1669. Ctrl U
  1670. ), type in your own filename and drag the file icon to any open directory. You might also be able to produce hard copy by 
  1671. saving
  1672.  the text to the 
  1673. Printers
  1674.  icon on the iconbar, although some recent printers contain no fonts of their own and therefore cannot print text files in this way. 
  1675. Look in 
  1676. PrintJobs
  1677. regularly and get rid of files which you no longer need. (See also 
  1678. 3.1.2
  1679. will 
  1680. sort the report
  1681.  on whatever column the mouse pointer was over when you clicked MENU, provide the report is in 
  1682. Horizontal format
  1683.  (see 
  1684. 3.2.1
  1685. . The default 
  1686. sort order is 
  1687. ascending
  1688. , i.e. from A-Z if alphabetic, from lowest to highest if numeric, from earliest to latest if dates or times (provided the fields are designated as type Date or Time). A submenu allows the choice of a 
  1689. descending
  1690.  sort
  1691.  if required. After sorting the report header shows the sort field and type of sort.
  1692. Shrink list
  1693. will remove as much surplus 
  1694. white space
  1695.  as possible from between the columns of a report. This item might be shaded: 
  1696. white-space removal
  1697.  can be set to occur automatically before the report is displayed (in fact this is the default setting). If this is the case no further space can be removed and the menu choice is therefore made unavailable.
  1698. Discard 
  1699. removes the report window from the screen and recovers the memory it occupied. You might find this useful if you run short of memory after creating a large report.
  1700. Restore
  1701. will put a sorted report
  1702.  back into the order it was in when first generated.
  1703. 3.1.2
  1704. Reloading saved reports
  1705. Reports saved from the report window to the 
  1706. PrintJobs
  1707.  directory may be reloaded. Unless 
  1708. PrintJobs 
  1709. is empty, 
  1710. Show jobs done
  1711.  on the 
  1712. Print
  1713.  submenu will itself have a submenu. Choosing a saved report from this menu using SELECT will reload the report and display it in exactly the same format, colours etc. as when it was first created. If in Horizontal format the report may be sorted and records can be retrieved by double-clicking (see 
  1714. 3.1.3
  1715. For the above reconstitution of the report window to be possible it is necessary to save three files for each report. One of these is a plain text file which may be viewed in an editor, printed out, incorporated into a wordprocessor document etc. The other two are data files with the same name as the text file stored in subdirectories called 
  1716. RecNums
  1717.  and 
  1718. Tabs.
  1719.  If either of these ancillary files is missing it will not be possible to display the report as it was and it will probably be simply loaded into your text editor instead. This is what will also happen with text files which get saved in 
  1720. PrintJobs
  1721. Powerbase
  1722.  functions other than normal database reports. 
  1723. To avoid leaving unwanted data files in 
  1724. RecNums
  1725.  and 
  1726.  when deleting a report it is best if deletion is carried out from the 
  1727. Show jobs done
  1728.  submenu rather than directly from a filer window. To do so, choose the reports to be deleted from the submenu using ADJUST. The menu will remain open and the chosen reports will be ticked. To untick a report click again with adjust. 
  1729. Delete ticked
  1730.  will only be unshaded when at least one report is ticked. Choosing 
  1731. Delete ticked
  1732.  will then delete all the ticked reports, removing all three files pertaining to each report. 
  1733. Delete all
  1734.  will delete the entire contents of the 
  1735. PrintJobs
  1736.  directory after requesting con
  1737. rmation.
  1738. An option button in the Preferences window, 
  1739. Re-load last report
  1740.  allows the last saved report to be auto-loaded on opening a database. This is deselected by default. To activate the facility you will need to select the button and save the Preferences file either in the database (in which case it is operative for that database only) or in 
  1741. Powerbase
  1742. , which will make it a default for all databases.
  1743. 3.1.3
  1744. Calling up records from the report window
  1745. The report window has one more useful feature. If you point at a particular piece of displayed data and double-click with SELECT the record window will come to the front displaying the relevant record. If the field corresponding to the item you clicked is editable the caret will be placed in that field. If you are using a report to look for errors in the data you can quickly correct them by this method but the report won
  1746. t change to reflect your corrections until you re-create it.  If you double-click with ADJUST instead of SELECT the record window opens at the pointer and its size and scrolling are adjusted to show only the required field. When a record has been retrieved by this method the relevant line in the report turns grey as a useful reminder.
  1747. 3.1.4
  1748. Text file destination
  1749. Save box
  1750.  will appear as soon as you tell 
  1751. Powerbase
  1752.  to go ahead and generate the report. The supplied pathname is the same as would be displayed when saving from the report window. Simply click 
  1753.  to save it in 
  1754. PrintJobs
  1755. under that name.  Alternatively, type a filename and drag the icon to an open directory. The report will then be created and the file closed.  Nothing else appears on the screen in this case. The File destination is of greatest use when reports are being produced from a Script file (see 
  1756. Ch 12
  1757. 3.1.5
  1758. Printer destination
  1759. When the 
  1760. Printer 
  1761. radio button is selected the 
  1762.  button alongside becomes available. (It is shaded when 
  1763. Window
  1764. Text file
  1765.  is selected.) Clicking 
  1766.  opens the Printer Setup window which provides a wide range of options. You may specify the number of copies to print, choose the font and point-size to be used, print with the paper upright (portrait) or sideways (landscape) and set the inter-line spacing and any or all of the four margins. All measurements other than font size may be specified in mm (default), inches or points. If you are using a colour printer the colours for headers/footers, report body and rules, as specified in the Print options window, will be reproduced.
  1767. Print formats
  1768. Powerbase
  1769.  is capable of producing reports in four different formats. Only two of these,
  1770.  Horizontal
  1771.  and 
  1772. Vertical
  1773. , are available when you print to a window or a file and these are selected via two radio buttons on the Print Options window. When the output destination is 
  1774. Printer
  1775.  two additional formats, 
  1776. Table
  1777.  and 
  1778. Label
  1779. , are also available and are selected from the Printer Setup window. These four formats will now be described.
  1780. 3.2.1
  1781. Horizontal
  1782. This is so-called because each record appears on a single, horizontal line with the fields aligned so that they form neat columns. Non-numeric fields are left-justified. Numeric fields, and others whose content is treated as a numeric value (see 
  1783. 3.5.2
  1784. ), are 
  1785. right-justified
  1786. . A header line identifies the columns by means of the tags or descriptors of the fields and this header can be made to appear on every page of the report or on the first page only. An optional descriptive title may also be incorporated. The 
  1787. Spacer
  1788.  is used to separate columns (see 
  1789. 3.10.2
  1790. ). All these features (and others) are chosen from the Print Options window.
  1791. Besides the ability to sort a report in a window (see 
  1792. 3.1.1
  1793. ) you may force 
  1794. Powerbase
  1795.  to sort the report 
  1796. before
  1797.  displaying it. To do so, select the 
  1798. Sort on 
  1799. option button in the Print Options window and enter in the associated writable icon either the tag of the field on which you wish to sort or the column number of the report. The feature is only of use in Horizontal and Table formats, but may be used with the 
  1800. Printer
  1801.  destination as well as with 
  1802. Window
  1803. . When the 
  1804. Sort on 
  1805. button is selected, another button next to the writable icon becomes active. Clicking on this toggles the blue arrow to point up or down, specifying either an 
  1806. ascending
  1807.  or a 
  1808. descending sort
  1809. 3.2.2
  1810. Vertical  
  1811. Fields are printed underneath each other with the identifier (tag or 
  1812. descriptor
  1813. ) at the left  hand side. Where the 
  1814. field selection
  1815.  includes an External text file, i.e a Text or 
  1816. Text block
  1817.  field, the 
  1818. Vertical
  1819.  format is the only one which may be used and will be selected automatically.  Although each field normally occupies a line to itself you can override this by holding down Shift as you click with ADJUST to select the field. You will then 
  1820. get a new line after the field: the next field to be selected will appear (with its identifier) on the same line. We will call this function 
  1821. field 
  1822. concatenation
  1823. It may be applied to any number of fields: keep Shift down while selecting all except the last one to appear on the line.  This feature is very useful if your report contains a mixture of long fields which need a line each and short ones which don
  1824. t and would otherwise result in wasted space and paper.  Concatenated fields are separated by the 
  1825. Spacer
  1826.  and the width of the report is governed by 
  1827. Text width
  1828.   (see 
  1829. 3.10.2
  1830. 3.2.3
  1831. Table
  1832. This, together with the Label format, is only available when outputting to the printer and the options associated with both formats are therefore selected from the Printer setup window. It resembles Horizontal format but the lines and columns are separated by horizontal and vertical rules, forming a grid. When this format is selected a number of extra features are enabled allowing you to include extra (blank) columns and lines, making this format especially useful when you want a list to which information is to be added by hand (e.g. entering marks against a printed list of students). The number and width of blank columns and the number of extra lines may be specified. For a tidy result it is recommended that you increase the 
  1833. line-spacing
  1834.  from the default 120% to about 150% when using Table format.
  1835. 3.2.4
  1836. Label  
  1837. This is meant for printing on special label stationery. Since such stationery is expensive you are advised to try out your settings on plain paper first! Selecting this format enables the label setup choices which include the label size and the number of labels in a row. It also allows optional fixed starting and finishing lines to appear on each label. The 
  1838. number of lines on the label
  1839.  is not needed: 
  1840. Powerbase
  1841.  works this out from the label height and print size and warns you if the data won
  1842. t all fit.
  1843. Printing will normally begin on the first label in the first row on the sheet but, to enable you to use up a 
  1844. part sheet of labels
  1845. , you may specify which label to begin with, e.g. for three-in-a-row labels, entering 5 would make printing start at the second label of the second row. (Remember that sheets in a feeder-hopper are upside-down!) After the first sheet the starting-point reverts to the first label in the first row.
  1846. Each field normally appears on a separate line but fields may be 
  1847. concatenated
  1848.  (see 
  1849. 3.2.2
  1850. ) with the 
  1851. Spacer
  1852.  being used to separate the fields (
  1853. see 3.10.2
  1854. ).  This may be necessary if you are using separate fields for surname and initials or surname and forename.
  1855. You may specify one 
  1856. field to be substituted
  1857.  for another if the latter is blank. Both fields are specified by tag and the 
  1858. Substitute
  1859.  button is set. This is useful in a school or college situation where labels are being addressed to parents.  Mature students, for whom the 
  1860. parent
  1861.  field in the record is blank, can have their own names printed instead. Another button makes the 
  1862. primary key
  1863.  of the record appear in small print on each label as a means of identification. This can be useful if the data printed on the label doesn
  1864. t make it obvious which record it comes from.   
  1865. What types of field can be printed?
  1866. Powerbase
  1867.  can use many different types of field.  All are described in 
  1868. 4.2.5 
  1869.  4.2.13 
  1870. in connection with setting up a new database and you should refer to those sections to clarify what follows here. You can 
  1871. print data from the following types of field
  1872. Editable
  1873. field (i.e.one into which you can type directly), including 
  1874. Scrollable lists
  1875. Computed
  1876.  and 
  1877. Stamp
  1878. fields (except Logos).         
  1879. External 
  1880. fields of 
  1881.  and 
  1882. Text block
  1883.  type, and the pathnames in 
  1884. Remote
  1885.  fields.          
  1886. Check-boxes
  1887. . What is printed for these differs from what you see in the check-box.
  1888. Thus:
  1889. (a) Tick/Cross  boxes result in 
  1890.            
  1891.       
  1892. (b) Tick/Blank  boxes, Option buttons and Radio buttons result in 
  1893.           
  1894. (c) Star/Blank  boxes result in an asterisk or 
  1895. (d) Blank/Tick/Cross boxes result in 
  1896. (e) ?/Tick/Cross boxes result in 
  1897. (f) Blank/M/F boxes result in 
  1898. Female
  1899. Note that (d), (e) and (f) are 
  1900. three-state check-boxes
  1901. ; (a), (b) and (c) are 
  1902. two-state check-boxes
  1903. . It is, of course, possible to print Draw and Sprite fields from 
  1904. individual 
  1905. records by loading the external file into 
  1906. Draw 
  1907. Paint 
  1908. and printing from that application (See 
  1909. 2.6.2
  1910. Specifying 
  1911. which fields to print
  1912. The field or group of fields selected for printing is called a 
  1913. print selection. 
  1914. Point at each of the required fields and click with ADJUST. The fields will be highlighted by reversing the foreground and background colours. Only those fields which are printable (see 
  1915. ) will respond to ADJUST in this way.  A second click will de-select the field. Note that the 
  1916. order 
  1917. in which you select the fields is important since that is the order in which they will appear in the report. The
  1918. menu button at the bottom-centre of the Match window (see 
  1919. ) will list the fields in the order in which they have been selected. 
  1920. Ctrl F 
  1921. has the same effect. (If no fields are selected 
  1922. Ctrl F
  1923.  gives a listing of 
  1924.  the fields.)
  1925. contiguous range of fields
  1926.  may be selected by placing the caret in the first field then double-clicking with ADJUST in the last.  To select 
  1927.  printable fields choose 
  1928. Select all (Ctrl A)
  1929.  from the 
  1930. Print 
  1931. submenu.  There is also a 
  1932. Clear selection
  1933.  entry on this submenu (
  1934. Ctrl Z
  1935. Although a Scrollable list is, strictly speaking, a single field, its columns are selected for printing individually. You will find, however, that the order in which the columns are highlighted is immaterial; they are always printed in the order in which they appear in the record window.
  1936. For other options applicable to printing Scrollable lists see 
  1937. 3.10.1
  1938. 3.4.1
  1939. Saving print selection files
  1940. Print selections
  1941.  may be saved for future use. 
  1942. Save selection
  1943.  from the 
  1944. Print
  1945.  submenu leads to a Save box. Accepting the default pathname will save the file with the name
  1946.  Selection
  1947.  in a directory called 
  1948. PrintRes
  1949. . Just as every database has its 
  1950. PrintJobs
  1951.  directory, so does it also have its own 
  1952. PrintRes
  1953.  (i.e. 
  1954. Print Resources
  1955. ) directory whose contents can be displayed with 
  1956. Show resources (Ctrl R)
  1957.  from the 
  1958. Print 
  1959. submenu. . 
  1960. Selection files
  1961.  are of type &7f3 and are distinguished by their icon which bears a large 
  1962. . Because they have a specific file-type which 
  1963. Powerbase
  1964.  recognizes they can be loaded by double-clicking on them. If 
  1965. PrintRes
  1966. t empty then 
  1967. Show resources
  1968.  will have its own submenu which provides another means of loading files.
  1969. 3.4.2
  1970. Default selection
  1971. You may save as many print selections as you like and their names may include any character which is allowed in file-names, but one name is special: a file saved as 
  1972. !Selection
  1973.  is treated as a 
  1974. default selection
  1975. . When you instruct 
  1976. Powerbase 
  1977. to create a report without having first highlighted the fields to be included, the default selection will be searched for in 
  1978. PrintRes 
  1979. and used. If there is no such file the primary key field(s) will be printed. As soon as the report is complete the selection is cleared. You won
  1980. t see the highlighting of the fields at all when a selection is used automatically in this way.
  1981. To save a default selection you need only select the option button 
  1982. Default selection
  1983.  in the Save box (thus causing the 
  1984.  to be added) and accept the supplied pathname by clicking 
  1985.  or typing Return.
  1986. Specifying which records to print
  1987. Unless we want to print all the records in the database we need some means of telling 
  1988. Powerbase 
  1989. what are the common features of the records we wish to print. There are two ways of doing this. The more versatile way (and the one which 
  1990. Powerbase
  1991.  uses by default) makes use of a 
  1992. search formula
  1993. query
  1994.  describing the characteristics of the required records.  The remainder of this section deals with the construction and use of search formulae.  For the alternative method, 
  1995. query by example
  1996. , see Section 
  1997. If you click the 
  1998. Print
  1999.  button on the tool-pane
  2000.  a small window with the title 
  2001. Find matching records
  2002.  appears. We will call this the 
  2003. Match window
  2004. .  The same thing happens if you choose 
  2005. Print
  2006.  from the main menu, or 
  2007. Create report 
  2008. Print 
  2009. submenu, or 
  2010. type the Print key on the keyboard. The most prominent feature of the Match window is a group of icons enclosed by a thin red border. This object is called the 
  2011. Query panel
  2012.  and you may have already seen it since it forms part of several windows. It appears on the Filter window for example (see 
  2013. 2.3.3
  2014. ) and is also used when making Global changes
  2015. 2.5.5
  2016. ), performing a Batch move/delete operation  (
  2017. 2.5.6
  2018. ), exporting a CSV file (
  2019. ) and creating a Subset (
  2020. The writable icon in the 
  2021. Query panel
  2022. , in whatever context the latter appears, is meant to take a 
  2023. search formula
  2024. . The simplest thing you can do, of course, is to type nothing at all! If you then click on the 
  2025. Print
  2026.   button you will create a list of all the records in the current subfile of the database. You could achieve the same result by typing 
  2027.  indeed if, after producing the above list with a null formula, you click on the 
  2028. button 
  2029. Ctrl O)
  2030. , which retrieves the last-used 
  2031. search formula
  2032. , you will find ALL displayed.
  2033. 3.5.1
  2034. The construction of 
  2035. search formula
  2036. Most database queries will involve a selected group of records. A 
  2037. search formula
  2038.  describes the criteria which records must match in order to be included in the report. Getting to grips with 
  2039. search formula
  2040. e is, perhaps, the biggest hurdle faced by the new 
  2041. Powerbase
  2042.  user and you are referred first to the simple examples described in the 
  2043. Tutorial
  2044. file. A 
  2045. search formula
  2046.  consists of one or more 
  2047. search element
  2048. search element
  2049.  specifies that a field value must fit a certain condition and takes the form:
  2050. <TAG LIST><
  2051. COMPARATOR
  2052. ><TARGET LIST> 
  2053. The angle brackets are there for clarity and are not used in entering the actual formula. There must be no spaces between the three parts. A
  2054.  tag list
  2055.  (if it contains more than a single tag) has the form:
  2056. tag1,tag2,tag3,.... 
  2057. where tag1 etc. are field 
  2058.  (see 
  2059. 4.2.4
  2060. ) which uniquely identify the fields to be matched. A 
  2061. target list
  2062.  (if it contains more than a single target) has the form:- 
  2063. target1,target2,target3,.... 
  2064. where target1 etc. are the data items which are to be compared with the contents of the fields specified in the tag list. The 
  2065. comparator
  2066.  which links the tag list and target list determines the type of comparison to be made. The commonest is 
  2067. , meaning that one of the items in the target list must exactly match the content of one of the fields in the tag list.
  2068. If the 
  2069. Case 
  2070. button
  2071.  on the 
  2072. Query panel
  2073.  is selected then all comparisons will be case-specific, e.g. 
  2074.  will be regarded as different from 
  2075. . If the 
  2076. Case 
  2077. button
  2078.  is not selected all those three will be considered identical. 
  2079. The heading of a report shows which fields were used in the search formula, what targets were specified and what type of comparison was made. If a target was placed in quotes (which is the only way of searching for any string containing a comma, for example) then it appears in quotes in the heading also.
  2080. It is impossible to describe the use of 
  2081. search formula
  2082. e adequately without quoting actual examples. As in the 
  2083. Tutorial
  2084. file we will make considerable use of the 
  2085. Elements
  2086.  sample database.  A simple example of a search formula consisting of a single search element is:
  2087. where GP is the field tag, = is the comparator and T is the target. This means 
  2088. The field whose tag is GP must contain the value T
  2089. , i.e. all transition elements (but no others) are to be included in the report. 
  2090. A slightly more complex one is:
  2091. GP=1,2,3
  2092. which would be interpreted as 
  2093. The GP field must match one of 1,2 or 3
  2094. . This may also be entered as:
  2095. GP=1 OR GP=2
  2096.  OR GP=3
  2097. which is possibly easier to understand but also somewhat longer.  A further example is:
  2098. OX1,OX2,OX3=3
  2099. meaning 
  2100. One of the first three oxidation state fields must have the value 3
  2101. This could also be entered as:           
  2102. OX1=3 OR OX2=3 OR OX3=3
  2103. Yet another way is:
  2104. OX1-OX3=3
  2105. i.e. you may specify a range of 
  2106. adjacent 
  2107. fields by giving the first and last separated by a 
  2108. hyphen
  2109. .  Where you don
  2110. t know which fields to test you can replace the tag, tag list or 
  2111. tag range with @
  2112. , which causes all the fields in the record to be examined.
  2113. Note that in these examples only 
  2114. of the fields in the tag list is required to match 
  2115. of the targets in the target list (although it doesn
  2116. t matter if more than one field matches more than one target). Sometimes we want an 
  2117. inclusive 
  2118. search
  2119.  so that 
  2120. of the fields in the tag list match a given target or, less frequently, a field contains 
  2121. of the values in the target list. It
  2122. s a matter of connecting the search elements with AND instead of OR. You can do exactly that (although the following example is chemically nonsensical!):
  2123. OX1=3 AND OX2=3
  2124.  AND OX3=3
  2125. You may also save typing by using the ampersand (&) instead of the word AND, but the same result can be achieved even more briefly by simply 
  2126. doubling the comparator
  2127. , in other words using 
  2128.  instead of 
  2129.  so that the formula becomes: 
  2130. OX1,OX2,OX3==3
  2131. The full 
  2132. list of available comparators
  2133. =, <>, <, >, <=, >=, { 
  2134. and  
  2135.        (N.B. 
  2136.  may be used instead of 
  2137.  should be read as 
  2138. contains
  2139.  and  
  2140.   as 
  2141. does not contain
  2142. .  These are used where the target value must (or must not) be part of the field but isn
  2143. t expected to make up the whole field.  The use of { is the main source of those rare instances where we want 
  2144.  the items in a target list to be matched in a given field. e.g. Suppose we knew that someone
  2145. s house number was 17 and that they lived on 
  2146. <something> Avenue
  2147.  but the actual name couldn
  2148. t be remembered.  In a database of addresses a search formula such as:
  2149. ADDR{{17,Avenue
  2150. (note the doubled comparator) would find it by listing all records where ADDR contained both 17 
  2151.  Avenue, whereas: 
  2152. ADDR{17,Avenue
  2153. would find all those addresses where the house number was 17, regardless of street name, and all those addresses with 
  2154. Avenue
  2155.  in them, whatever the house number. 
  2156. You may invert the logic of a search criterion by putting
  2157. in front of it. To print all non-transition elements you could use:
  2158. NOT (GP=T)
  2159. Note the space after 
  2160. , the need for brackets, and that the syntax 
  2161. GP NOT=T
  2162. . You could equally well use one of the following:
  2163. GP<>T 
  2164.  GP~T
  2165. and may find either of these more understandable. To make 
  2166. multi-criterion searches
  2167.   either place 
  2168.  and targets in comma-separated lists as described above or string search elements together with the connectives AND and OR. Use AND (or the ampersand, &) when a field must meet 
  2169. of a set of criteria. e.g.
  2170. GP=T & Z>50 & NAME{IUM
  2171. for all transition metals with atomic numbers greater than 
  2172.  and names containing 
  2173. . Use 
  2174. when a field need meet only 
  2175. of a set of criteria. e.g.
  2176. GP=L OR GP=A 
  2177. would find all lanthanide and actinide elements as the formula means 
  2178. either 
  2179. L or A
  2180. ; I don
  2181. t care which
  2182. . AND and OR
  2183. can produce ambiguous search formulae e.g.
  2184. GP=1 OR GP=2 AND Z<50
  2185. could mean either 
  2186. elements in group 1 or 2 (don
  2187. t care which) with atomic numbers less than 50
  2188.  or  
  2189. group 1 elements (of any atomic number) or group 2 elements whose atomic numbers are less than 50
  2190. You probably want the former, but 
  2191. Powerbase
  2192.  will give you the latter. To get what you require use brackets to make the logic clear. In other words write it as:
  2193. (GP=1 OR GP=2) AND Z<50
  2194. You could also write this as:                
  2195. GP=1,2 & Z<50    
  2196. without any need for brackets at all.
  2197. 3.5.2
  2198. Numeric and other special fields in search formulae
  2199. For most types of field the comparison with the target is made by 
  2200. character matching
  2201.  but for certain types the comparison uses the  
  2202. numeric value 
  2203. of the field
  2204. . The fields concerned are:
  2205. Numeric, Calculated, Record number, Sequence number, Day of month, Month number, Year
  2206. Only the first of these is an editable field type but all may be included in search formulae. Suppose we have a Numeric field whose tag is NUM.  If you entered the formu
  2207. NUM=5
  2208. the record would be included in the report if NUM contained 5, 05, 5.0 etc. because all of these have the same numeric value. If you had an Alphanumeric field called NUM the same search formula would only match records where the content was 
  2209. literally 
  2210. 5, i.e. the character 
  2211. . This can easily catch you out. Suppose, for example, you want to print records for which NUM<8. You might be surprised to find records in which NUM contains values such as 55, 20, or 13 being printed, as well as those containing 4, 6, 2 etc!  If this happens check what type of field NUM is.  Unrestricted and Alphanumeric fields will give the above result; Numeric fields (and the others listed above) will give the result you probably want.
  2212. You can 
  2213. force 
  2214. comparison by numeric value
  2215.  for a field which consists of (or, at least, begins with) numerals, even though the field is not defined as of Numeric type,  by enclosing the field tag in square brackets, e.g. 
  2216. [NUM]<8
  2217.  would produce the desired result in the above example even if the field is Alphanumeric or Unrestricted. This is useful where you want to make a comparison but still allow the field to accept non-numeric characters. The comparison-by-value can only work in such cases if the number part of the field comes first. e.g. it will deal correctly with 55A, 20B, 13X but not with A55, B20, X13. 
  2218. 3.5.3
  2219. Using 
  2220. wild-cards
  2221. search formula
  2222. The use of characters 
  2223.  and 
  2224. wild-cards
  2225.  was described in 
  2226. 2.5.5
  2227.  in connection with search-and-replace operations. They may be also be used in 
  2228. search formula
  2229.  is used to represent a 
  2230. group 
  2231. of characters and 
  2232.  to represent 
  2233. single 
  2234. characters which do not need to be matched.  e.g. If (still using the 
  2235. Elements
  2236.  database) you type:
  2237. NAME=$ON
  2238. you are, in effect, saying 
  2239. find all the elements whose names end in ON
  2240. ; I don
  2241. t care what precedes ON as long as nothing follows it
  2242. Powerbase 
  2243. will duly find 
  2244. CARBON, BORON, NEON etc.  If you were to use:
  2245. NAME=$ON$
  2246. You would find PLUTONIUM, POLONIUM and a few others but 
  2247. none 
  2248. CARBON, BORON, NEON etc. Something must 
  2249. follow 
  2250. ON as well as precede it. (To print both sets of elements you would use 
  2251. NAME{ON
  2252. Note also that:
  2253. NAME=$TIN$
  2254. finds PROTOACTINIUM,  PLATINUM etc, but 
  2255. TIN itself.
  2256. NAME=S$IUM
  2257. finds all names which begin with 
  2258. and end with 
  2259. , e.g. SAMARIUM, 
  2260. SCANDIUM
  2261. and SODIUM.  The effect of:
  2262. NAME=S####IUM
  2263. is somewhat different. You are, again, asking for names which begin with S and end with IUM but this time SAMARIUM and SCANDIUM would be found, but 
  2264. SODIUM since you have specified exactly 4 
  2265. wild-card
  2266. ed letters between the S and the I.  Finally, to find any 5-letter name, regardless of the actual letters:
  2267. NAME=#####
  2268. 3.5.4
  2269. Querying scrollable lists
  2270. If search elements are formulated in exactly the same way as for other fields, the entire list is examined for a possible match. e.g. If the tag of a Scrollable list is LIST entering:
  2271. LIST=<target>
  2272. will search every cell of the list and report the record as a match if any one or more cells contain the target string. The test can be restricted to a single column of the list by appending the column number as follows:
  2273. LIST#2=<target>
  2274. which would search cells in the second column only.
  2275. Data in Scrollable lists is always of string type, even when it consists wholly of numerals. A comparison such as:
  2276. LIST#2>15
  2277. will therefore fail to give the desired result. The trick of placing the tag in square brackets (see 
  2278. 3.5.2
  2279. ) will work, however. 
  2280. The following formula will find records in which a cell in column 2 has numeric value>15:
  2281. [LIST#2]>15
  2282. 3.5.5
  2283. Comparing the contents of two fields
  2284. A field tag (instead of a literal string) may be specified as a target, thus allowing two fields in a record to be compared to produce, for example,  a list of all records in which the relevant fields have the same content.  This might interfere with a 
  2285. normal
  2286.  query where the required literal target happens to be the same as the tag of another field. The problem can be overcome by enclosing the literal string in quotes.
  2287. 3.5.6
  2288. Saving search formulae for re-use
  2289. Choosing 
  2290. Save query
  2291.  from the 
  2292. Print
  2293.  submenu opens a Save box from which the search formula may be saved. By default the file is saved in 
  2294. PrintRes
  2295.  under the name 
  2296. Query
  2297. . Selecting the 
  2298. Save as default
  2299.  button on the Save box will cause the file to be saved as the 
  2300. default query
  2301.  with the name 
  2302. !Query
  2303. . If such a file exists in 
  2304. PrintRes
  2305.  it will be automatically entered in the Query panel whenever the Match window is opened. A default query file, in other words, behaves in a similar way to a default selection file as described in 
  2306. 3.4.2
  2307. Query files
  2308.  are of type &7f4 and are recognizable by the large 
  2309.  in their icon. You may save as many Query files as you like and load them into the query panel by double-clicking on them.
  2310. Query by example
  2311. After that lengthy description of the 
  2312. search formula
  2313.  method of querying the database we turn to the alternative: query by example.  For brevity when comparing the two we will refer to them as 
  2314.  and 
  2315.  respectively.  To select query by example choose 
  2316. Preferences
  2317.  from the iconbar menu, select the option button 
  2318. Query by example
  2319.  and click on 
  2320. Accept
  2321. . The option then becomes active for 
  2322.  operations which would otherwise involve typing a search formula into the Query panel.
  2323. 3.6.1
  2324. What is 
  2325. The user is presented with a blank record and invited to type into the relevant fields the data which must be matched in order for the record to be included in the report. What you are saying in effect is: 
  2326. I want a list of all records which look like this. I don
  2327. t care what
  2328. s in any of the fields I haven
  2329. t filled in, but the ones I 
  2330.  filled in must correspond to what I have typed.
  2331.   e.g. in the 
  2332. Elements
  2333.  database if you wanted to print a list of all transition metals you would simply enter
  2334. in the 
  2335. Group 
  2336. field and then click 
  2337. Print
  2338.  on the Match window
  2339. .  The 
  2340. of the field isn't needed at all, whereas using a search formula requires you to type 
  2341. . Although you can
  2342. t normally place the caret in Computed 
  2343. elds and Stamp 
  2344. elds you
  2345. nd that you can do so when using the blank QBE record. Check boxes will initially display an 
  2346.  (for 
  2347. ignore
  2348. ) and any check-box left in this state will be ignored in the query. Clicking a check-box when setting up the query removes the 
  2349.  and displays the normal sprites (tick, cross etc.). Check-boxes so treated do 
  2350. gure in the query. Enter the data to be matched then  either click with SELECT on the 
  2351. Print
  2352.  button of the Match window or else type the Print key.
  2353. If you simply enter the required target strings 
  2354. Powerbase
  2355.  assumes that you want the all relevant fields to match 
  2356. exactly
  2357. , i.e the effect is the same as using 
  2358.  in every search element (see 
  2359. 3.5.1
  2360. ) of a search formula, connecting the search elements with AND. There are, however, other  comparators besides 
  2361.  which may be used in search formulae. (see 
  2362. 3.5.1
  2363.  for explanation and complete list). You may use any of these in a QBE query by placing them at the start of the string, e.g. 
  2364. {Avenue
  2365.  in an Address field would match all records where the field 
  2366. contained
  2367.  the word 
  2368. Avenue
  2369. .  An address such as 
  2370. 15 Acacia Avenue
  2371.  could be found by this method whereas just entering the word 
  2372. Avenue
  2373.  wouldn
  2374. t work because it would require the field to read 
  2375. Avenue
  2376.  and nothing more. 
  2377. Wildcards may be used; e.g. you could print from the 
  2378. Elements
  2379.  database all elements ending in IUM by entering 
  2380.  in the 
  2381.  field or all those whose symbol began with H by entering 
  2382.  in the 
  2383.  field.
  2384. You may specify a 
  2385. target list
  2386.  (see 
  2387. 3.5.1
  2388. ) to make the search include all records matching any item in the list. e.g. 
  2389. Leeds,Liverpool,Manchester
  2390.  in a Town field (if it will fit) would cause records with any of these places to be included. You can also specify a 
  2391. field list
  2392.  (equivalent to a 
  2393. tag list
  2394. ; see 
  2395. 3.5.1
  2396. ) provided that the fields form a contiguous group. The target string (which may be a target list, be wild-carded or be preceded by a comparator) is entered in the first field of the group. Press Return and enter " (double quote or 
  2397. ditto
  2398.  mark) in the next field and for the remaining fields of the group. (Pressing Return rather than moving the caret by means of the mouse ensures that you really are dealing with a contiguous group of fields.)
  2399. 3.6.2
  2400. QBE vs QSF
  2401. So what are the advantages and disadvantages?  QBE is very intuitive and avoids the need to bother with field tags or the minutiae of search formula syntax. On the other hand QSF is more comprehensive and flexible: there are some things you simply cannot do with 
  2402. QBE.  Some of the limitations
  2403.  have already been mentioned but here is a complete list:
  2404. Except where exact matches (
  2405. field=target string
  2406. ) are required it might not be possible to fit the comparator-plus-target string or list into the field.  You can't, for example, target a Date field for all dates prior to, say, 01-06-90 since dates fit their fields exactly leaving no room for the necessary < comparator.  Such a search is perfectly possible with QSF.
  2407. Searches involving multiple fields and the same target, i.e. those where FieldX 
  2408. FieldY 
  2409. FieldZ must match are only possible where the fields form a contiguous sequence. With QSF it is possible to perform such searches on fields dotted about the record.
  2410. There is no equivalent in QBE to the @= (
  2411. field in the record matches) or @{ (
  2412. field contains) searches which are possible with QSF.
  2413. You can't search for text in an external Text or Text Block field. You can with QSF.
  2414. Since QBE doesn't use tags you can
  2415. t force a comparison-by-numeric-value on a non-numeric field (See 
  2416. 3.5.2
  2417. If your requirements involve only fairly simple searches then QBE might be just what you
  2418. ve been looking for, but if complex multiple searches are often needed then QSF is the one to go for. It is, of course, a simple matter to switch between the two.
  2419. As supplied 
  2420. Powerbase
  2421.  uses QSF as the default query method and the 
  2422. Query by example
  2423.  button will be deselected when the Preferences window is displayed. 
  2424. If you want to make QBE the default you can save your 
  2425. Preferences
  2426. le either in the database (in which case only that database will use QBE by default) or in 
  2427. Powerbase
  2428.  itself to make all databases use QBE.
  2429. Other features of the 
  2430. Query panel
  2431.  and 
  2432. Match window
  2433.  buttons on the Query panel have already been dealt with. Selecting 
  2434. Reverse
  2435.  causes whatever index is in use to be scanned in reverse order, e.g. alphabetical lists will be produced in Z-A order.
  2436.  opens the 
  2437. Help window
  2438.  which offers another way of building 
  2439. search formula
  2440. e which might appeal to beginners. Select the target field by cycling through the 
  2441.  with the bump icons or by choosing from the pop-up menu.  Choose the 
  2442. comparator
  2443.  by selecting a radio button. Type the target value into the writable icon. Place the caret in the Query panel writable icon and click 
  2444. Add to formula.
  2445.   The 
  2446. search element
  2447.  will appear at the caret.  You may click on 
  2448. and enter other search elements in the same way. If you wish to use
  2449.  button you must do so 
  2450. before
  2451.  clicking 
  2452. Add to formula
  2453. Powerbase
  2454.  inserts the brackets round the 
  2455. search element
  2456.  for you.
  2457. Holding down Ctrl and clicking on a field with SELECT while the caret is in the 
  2458. Query panel
  2459.  causes the tag of the field to be entered in the 
  2460. search formula
  2461.  at the caret. This, together with the above method of constructing 
  2462. search formula
  2463. e, largely overcomes the problem (especially when using someone else
  2464. s database) of not remembering what the field 
  2465.  are.
  2466. At the far left of the Match window is a group of four radio buttons labelled 
  2467. Print
  2468. Count
  2469.  and 
  2470. Clear
  2471. . Only one of these may be selected at a time and the default action button at the bottom right of the window reflects whichever one you select. When the Match window is opened it is always 
  2472. Print
  2473.  which is selected, this being the most often used feature. If you merely want to know how many records match a specified set of criteria, without printing them, select 
  2474. Count
  2475. . The number of matching records appears to the left of the 
  2476. Cancel
  2477.  button (which merely closes the window).  
  2478.  and 
  2479. Clear
  2480.  are explained in 
  2481. 3.8.2
  2482.  below.
  2483. Fields selected
  2484.  menu
  2485.  button will be shaded if there is no field selection, otherwise it lists the selected fields 
  2486. in the 
  2487. order of selection
  2488. . This last is well worth remembering since there is no other indication of the order in which fields were selected for printing. The icon just to the left indicates the selected 
  2489. output destination 
  2490. (see 
  2491. ) by displaying a representation of a window, a text-file icon, or a printer. In the latter case the icon will be shaded if no printer driver is loaded. Clicking with SELECT on the icon 
  2492. opens the Print Options window
  2493. ; in fact you might find this the most convenient way of doing so.
  2494. In many databases some keys may be repeated several times. This is especially true of subsidiary keys, but sometimes also occurs with primary keys. A report created with 
  2495. Ignore repetitions of key
  2496.  selected will contain only the first record having a given key; subsequent ones will be skipped.
  2497. 3.7.1
  2498. Printing records from 
  2499. more than one subfile
  2500. Reports are usually created from records in the currently-selected subfile which is displayed in the title bar of the record window. Just under the Query panel is the legend 
  2501. Include subfiles:
  2502.  and a row of numerals, 0-5. When a database is opened 0 will be highlighted, indicating that reports will only include records from subfile 0. If you change subfile by clicking on the appropriate tool-pane buttons you will see this highlighting move from one number to another, showing the selected subfile. You can, however, click on these numbers so that any or all of them are selected. Subfiles are deselected with a second click.
  2503. When you create a report from more than one subfile the records are not merged into one alphabetically (or numerically) ordered list; the ordering starts afresh for each selected subfile. This isn
  2504. t really a problem because you can always sort the completed report  on any field to produce a single, ordered list (see 
  2505. 3.1.1
  2506. 3.7.2
  2507. Including record number, key and subfile number
  2508. A group of three option buttons in a frame to the left of the query panel allow you to include record numbers, the current key, and the 
  2509. subfile number in a report
  2510. . The latter is especially useful if you have created a report from several subfiles and then sorted it as described above. If you need to keep track of which subfile a record comes from, create the report with 
  2511.  selected. The position in which these items appear in a report depends on the point at which the option buttons are selected. Think of selecting these buttons as an extension of selecting data fields, e.g. selecting a data field, then selecting the 
  2512. button, then finally selecting another data field would lead to a report in which the key was printed between the data fields. The extra items appear in blue on the 
  2513. Fields selected
  2514.  menu and are saved as part of a 
  2515. Selection
  2516.  file.
  2517. Marking records
  2518.  for inclusion or exclusion
  2519. 3.8.1
  2520. Arbitrary selection of records
  2521. There are times when you want to print a number of records which have no obvious connection with one another: they may have a common feature which is obvious to 
  2522.  but none within the records themselves.  Such a situation commonly occurs when you want to print a few mailing labels.  No common feature means no basis for constructing a search formula. So how do you tell 
  2523. Powerbase
  2524.  which records you want to print? 
  2525. A small panel attached to the bottom of the record window contains a check-box, 
  2526. Mark for printing etc.
  2527. , which you can tick to indicate that the displayed record is to be printed.  If this panel is not present type 
  2528. Ctrl M
  2529. , which toggles the feature on and off. With the default settings of 
  2530. Powerbase 
  2531. the mark panel is displayed but it can be turned off by an option in the 
  2532. Config 
  2533. file (see 
  2534. ). Even so, 
  2535. Ctrl M
  2536.  will always bring it back. Using the 
  2537. Search 
  2538. button or the browse controls you can call up each record you want and tick the box. You then simply select the required fields and print in the usual way. If no search formula has been entered then 
  2539. only 
  2540. the marked records will be printed. (Printing without a search formula when no records are marked gives the whole subfile as described in 
  2541. )  If you do enter a search formula you will get the records which match the formula 
  2542.  the marked records, whether the latter match the formula or not.
  2543. A pop-up menu allows you to invert the effect of this feature so that printing without a search formula gives all records in the subfile 
  2544. except
  2545.  the marked ones and printing with a search formula gives all the matching records 
  2546. except
  2547.  for those marked. When the menu option is set like this (to exclude rather than include) the check-box shows a red cross instead of a green tick.
  2548. Next to the check-box is the 
  2549. Clear marks
  2550.  button which does exactly what it says. It is shaded when no record is marked. A further indication of whether records are marked is provided by the icon at the far right of the Query panel which displays either the green tick or the red cross when any record is marked. This applies to the 
  2551. whole
  2552.  database, by the way, not just to the current subfile.
  2553. Powerbase
  2554.  takes heed of marked records in any operation which involves the query panel, i.e. batch move/delete, global change, filter, export subset, export CSV file, as well as print. 
  2555. 3.8.2
  2556. Groups of records
  2557. It is sometimes useful to be able to mark (or clear marks from) a group of records which fit a search formula. This is made possible by the 
  2558.  and 
  2559. Clear
  2560.  radio buttons on the Match window.  By repeatedly selecting 
  2561.  and executing different query operations you can build up a set of marked records by stages then, if desired, selectively clear the marks from certain ones. Finally, you can print your carefully-tailored selection of marked records without using a search formula at all.
  2562. Printing only the displayed record
  2563. Hold down Shift whilst clicking with SELECT on the 
  2564. Print
  2565.  button of the Match window or type 
  2566. Shift-Print
  2567.  on the keyboard. Yet another method is to mark the displayed record as described in 
  2568. 3.8.1
  2569.  then do a 
  2570. Print ALL
  2571. . Only the marked record will be printed. The highlighted fields of the displayed record are printed using the currently-selected print format as determined by the setting in the Print options window.  If no fields are selected the action is as described in 
  2572. 3.4.2
  2573. Powerbase
  2574.  will use the default selection if it exists or, failing that, print the primary key fields only.
  2575. print options
  2576.  window
  2577. To display this window you can choose 
  2578. Options
  2579.  from the 
  2580. Print
  2581.  submenu, type 
  2582. Ctrl Print
  2583. , or click SELECT on the icon to the left of the 
  2584. Fields selected
  2585.  menu on the Match window. Features such as Destination (see 
  2586. ), Format (see 
  2587. )  and the 
  2588. Sort on 
  2589. facility (see 
  2590. 3.2.1
  2591. ) have already been dealt with extensively. The rest are covered here.
  2592. 3.10.1 Scrollable lists
  2593. These may be printed in two different ways. The default is for all the cells in the selected columns of the list to be made into a 
  2594. single line
  2595. . The entries in 
  2596.  and 
  2597. Row end
  2598.  are the strings used to separate data from individual cells in the same row of the list and to separate one such row from another. The defaults are 
  2599. ,<sp>
  2600.  and 
  2601. ;<2sp>
  2602.  respectively but you may provide your own strings (up to 5 characters each) if you prefer.
  2603. This format can result in very long lines indeed, especially if all the columns of multi-column lists are included in the print selection. An option button (
  2604. Shrink line
  2605.  - selected by default) causes as much white space as possible to be removed, but lines could still be too long for the printer.
  2606. The alternative format puts the data from each row of the scroller on a separate line so that the data aligns in 
  2607. columns
  2608. . This occupies less room horizontally but much much more vertically.  
  2609.  is used between the data from cells in the same row but 
  2610. Row end
  2611.  is shaded because nothing is needed to delineate rows.
  2612. It can be very inconvenient to have an entire list (or even all the data from a single selected column) included in a report when only a single cell is of interest. The option button 
  2613. Only if targetted in query
  2614.  (deselected by default) overcomes 
  2615. the problem by restricting what is printed to those rows in which the contents of a cell match a target in the search formula.
  2616. 3.10.2 The rest of the print options
  2617. The remaining options require only brief explanations. Default settings appear in brackets after the name of the feature.
  2618. Headings
  2619.  (tags)
  2620. appear at the head of reports in all formats except 
  2621. Label
  2622.  unless 
  2623.  is selected.
  2624. Expand codes
  2625.  (OFF) 
  2626. causes extra data from a 
  2627. validation table
  2628.  to be substituted for (or added to) the coded data in fields linked to such tables (see
  2629. Expand headers
  2630.  (ON) 
  2631. will show the expanded versions (see 
  2632. ) of the target values for fields linked to validation tables in the list header.  Turning the option OFF causes the target values to be shown exactly as typed in the search formula.
  2633. Upper case
  2634.  (OFF) 
  2635. causes all textual output to appear in capital letters.
  2636. Print 
  2637. header
  2638.  (ON) 
  2639. causes the printing of 
  2640. header
  2641.  lines at the beginning of each page.  The 
  2642. header
  2643.  includes the following information:
  2644. The name of the database plus a title, derived from the 
  2645. search formula
  2646. , making it clear on what basis the records have been chosen.
  2647. index
  2648.  used for the ordering, plus the 
  2649. date stamp
  2650.  (if appropriate button selected).
  2651. An optional description entered in the 
  2652. Title
  2653.  writable icon
  2654. column headings
  2655.  as described above.
  2656. The next button 
  2657. (on p. 1 only: 
  2658. default
  2659.  OFF) 
  2660. limits the 
  2661. header
  2662.  to the first page of a report.
  2663. Print 
  2664. footer
  2665.  (ON)
  2666. Reports in 
  2667. Horizontal
  2668.  and 
  2669. Table
  2670.  format
  2671.  normally end with a 
  2672. footer
  2673.  which specifies the number of records printed.  If the output includes 
  2674. Numeric 
  2675. or Check-box fields and column calculations have been selected (see 
  2676. ) the results of these too will be part of the 
  2677. footer
  2678. Date stamp
  2679.  (ON) 
  2680. makes the date and time when the report was created appear as part of the 
  2681. header
  2682. Shrink list
  2683.  (ON)
  2684. Horizontal
  2685. Table 
  2686. format
  2687.  the width of columns is determined by the maximum defined length of the fields included in the print selection. These lengths are often greater than the length of data actually present in the fields, resulting in a lot of 
  2688. white space
  2689.  between columns. With this option ON the surplus space will be automatically removed. Even if it is OFF you can still remove white space via the Report menu (see 
  2690. 3.1.1
  2691. ). Output to 
  2692. Printer
  2693. always
  2694.  removes white space whether this button is ON or OFF
  2695. Page numbers
  2696.  (OFF) 
  2697. allows page numbers  to appear at the bottom of each page of a report. This feature works quite independently of the 
  2698. Print 
  2699. footer
  2700.  button.
  2701. Page length
  2702.  (0) 
  2703. determines the 
  2704. total length of page, including 
  2705. header
  2706. footer
  2707.  and 
  2708. top margin, 
  2709. for destinations other than 
  2710. Printer
  2711.  (for which the page length is determined by the top and bottom margin settings).  The default value of 0 means no division into pages at all, but you might want to alter this if you drag text-files to the printer. An A4 page is 70 lines long, but you won
  2712. t be able to print on them all and page-feeds might occur in the wrong place. Look at 
  2713. Edit paper sizes
  2714.  on the iconbar menu of 
  2715. Printers
  2716. . Subtract the displayed top and bottom text margins from 70 and enter the resulting value. In 
  2717. Vertical
  2718. format 
  2719. Powerbase
  2720.  will try to avoid splitting a record between pages, but this can happen if the report includes Text or 
  2721. Text Block
  2722.  fields of greatly varying length. (It will also happen if the number of fields to be printed exceeds the length of the page!)
  2723. Text width
  2724.  (A) 
  2725. specifies the line length used when printing in 
  2726. Vertical
  2727. format. 
  2728.  means 
  2729.  and lets the program calculate the value. You may enter your own value (e.g. 70) to override this.
  2730. Colours 
  2731. (red, black, green
  2732.  respectively
  2733.  may be chosen for headers (also footers), the report body, and rules. Only foreground colours may be specified. This is done by clicking on the icons with SELECT to cycle through the 16 standard Wimp colours. (ADJUST cycles in the reverse direction.) The colours are used for reports sent to a 
  2734. Window 
  2735. or to the 
  2736. Printer
  2737. Spacer
  2738.  (1) 
  2739. specifies how fields printed on the same line will be separated. Fields are first padded with spaces to the maximum width of the relevant data field (but see 
  2740. Shrink list
  2741.  above) and the spacer string is then printed before starting the next field. Four interpretations of the contents of this icon are possible:
  2742. A number by itself means use the specified number of spaces
  2743. A number followed by a non-numeric character means use a string of the specified number of that character, e.g. 
  2744.  means 3 hyphens
  2745. A wholly non-numeric string is normally used 
  2746. as is
  2747. , e.g.
  2748. but:-
  2749. A string containing | or 
  2750.  produces solid or dotted vertical rules between columns when outputting to Window or Printer in Horizontal format
  2751. 3.10.3 Saving 
  2752. print options files
  2753. All the settings in the Print Options and Printer Setup windows may be saved as a Print Options file. Clicking 
  2754. Save choices
  2755.  with the 
  2756. in database
  2757.  radio button selected brings up the familiar Save box. By default the file is saved in 
  2758. PrintRes
  2759.  under the name 
  2760. PrintOpts
  2761. . As with Selection (see 
  2762. 3.4.1
  2763. ) and Query files (see
  2764.  3.5.6
  2765. ) you can save a default options file called 
  2766. !PrintOpts
  2767.  by selecting the 
  2768. Default options
  2769.  button on the Save box and 
  2770. Powerbase 
  2771. will load this whenever the database is opened. Options files have a large 
  2772.  on their icon and a filetype of &7f5. You may save as many as you wish and load them with a double-click. If the 
  2773. in Powerbase
  2774.  radio button is selected the options are saved as the 
  2775. Powerbase
  2776.  default and no Save box is displayed. 
  2777. Load default
  2778.  reloads this file, overwriting any changed settings.
  2779. The printer setup window
  2780. When the report destination is set to 
  2781. Printer
  2782.  clicking 
  2783. Lots more
  2784.  on the Print options window gives access to the Printer setup window. Some of the features of this window have already been described in connection with the Table (
  2785. 3.2.3
  2786. ) and Label (
  2787. 3.2.4
  2788. ) formats. Despite the complexity of the window most of the rest is fairly self-explanatory and only a few comments are necessary.
  2789. 3.11.1 Line length and point size of fonts
  2790. It is very easy to choose a combination of field-selection and point-size which makes it impossible to fit the entire line into the available width, especially if the paper is upright (portrait mode) and printing in two or more columns is selected. When 
  2791. Powerbase 
  2792. has prepared the first page of data for printing it looks to see whether the longest line will fit. If not, it calculates what the point-size would have to be reduced to in order to make it fit. If this results in an unfeasibly small size (less than 6pt) you will be advised of this and asked if you wish to proceed at the original point-size with some loss of data or cancel the job. (You will be told which field(s) will be omitted or truncated.)
  2793. If the calculated new size is 6pt or greater you have three choices: use the new size, proceed with the old size (with data loss as described above) or cancel the job. If the print job is cancelled you should then look to reducing the number of fields printed or changing the print format.
  2794. 3.11.2 Print margins
  2795. There are places in the window for setting all four margins. If, however, you set a margin which is less than the minimum specified by the printer driver (which will probably mean as near the edge of the paper as the printer is capable of printing) then the printer driver
  2796. s minimum is used instead. This particularly affects the minimum bottom margin which is quite large on many ink-jet printers; possibly 15mm or more. If you specify a bottom margin of 10mm and find you get one of 15mm it probably isn
  2797. Powerbase
  2798.  fault! If a printer driver is loaded the 
  2799. As printer
  2800.  button will be available and all four of the printer driver
  2801. s minimum margins will be used.
  2802. 3.11.3 Printing speed
  2803. Hard copy printing from 
  2804. Powerbase
  2805. t wonderfully fast but you can help things along by choosing sensible options in 
  2806. !Printers
  2807. . Some users run a high-resolution colour ink-jet printer at 1440dpi in a colour mode and never think to alter it. We
  2808. re only printing text, when all
  2809. s said and done 
  2810.  720dpi will produce excellent text quality and will be 4x as fast. 360dpi will be 
  2811.  as fast as 1440! For rough draft work even 180dpi might be acceptable, if your driver allows such a setting. Many users are unaware that using the printer in a colour mode is much slower, 
  2812. even when printing black only
  2813. , than in a monochrome mode. (The software has to look for colours which 
  2814. might
  2815.  be there, even though you know they aren
  2816. t!)  Finally, the use of a good printer-spooler application such as 
  2817. !FastSpool+
  2818.  will cause control to be returned to the user that much more quickly and is highly recommended.
  2819. Field analysis reports
  2820. Field 
  2821. submenu has an 
  2822. Analyse 
  2823. option which allows you to print a breakdown of the field contents under certain special circumstances:
  2824. (a)  If the field is 
  2825. index
  2826. the menu entry will read 
  2827. Analyse index
  2828. . When chosen it will produce a list of all the values in the 
  2829. index
  2830.  with the number of times each one occurs. e.g. A database of college students might have a field for the school of origin. If there are 20 different schools and if the field is 
  2831. index
  2832. ed then a list of those schools will be generated showing how many students came from each school. 
  2833. (b) If the field contains an 8 or 10 character date (e.g. 19-10-42 or 19-10-1942) the menu entry reads 
  2834. Analyse months
  2835.  and a breakdown by month will be printed. There will be a line for each month showing the number of records for that month. For example, this could be used in an orders database to find out quickly how many orders were received or dispatched each month. This feature works on editable 
  2836. Date field
  2837. s and also on 
  2838. Date stamp
  2839. 8 and 
  2840. Date stamp
  2841. 10 fields in the Stamp class.
  2842. It is, of course, possible for a field containing a date to be 
  2843. index
  2844. ed. Action (a), above, takes precedence in such a case. You can, however, force action (b) instead by first selecting the field with ADJUST, then choosing from the menu. For cases not described above the menu entry simply says 
  2845. Analyse 
  2846. and is shaded. Printing is always to a window (from which the report may, of course, be saved); the 
  2847. Destination 
  2848. buttons in the 
  2849. Print options
  2850.  window have no effect.
  2851. Subsidiary indexes
  2852.  and 
  2853. printing speed
  2854. Try the following experiment using the sample database 
  2855. Elements 
  2856. Create a subsidiary index, if one doesn
  2857. t already exist, on the Group field (see 
  2858.  for the way to do this). 
  2859.  make the index case-specific
  2860. Enter the formula 
  2861.  and click 
  2862. Print 
  2863. with ADJUST so that the Match window remains open. Note the time taken for creating the report. 
  2864. Deselect the 
  2865.  button and repeat the process.  The time will be shorter.  You might also notice the brief appearance of a numeral (probably 1) in the small rectangle to the right of the search formula in the Query panel.
  2866. The speed increase is most noticeable with a slow machine such as an A3000.  On a StrongArm RiscPC and with such a small database both times will be so short that the user
  2867. s reaction might be 
  2868. So what?
  2869.  but when dealing with databases of thousands of records the improvement can be quite dramatic.
  2870. What happens is that 
  2871. Powerbase
  2872.  detects the fact that there is an index based on the Group (GP) field, goes straight to the first occurrence of 
  2873.  in that index then prints records for as long as the key remains 
  2874. .  The number briefly displayed in the Query panel is the number of the index being used and its appearance shows the user that a subsidiary index is being used.  If you look at the header of the report you will see that it says 
  2875. Ordered by GP index
  2876.  whereas the first time it said 
  2877. Ordered by PrimaryKey
  2878. .  The speed-up only works when the all following conditions are met:
  2879. The search formula must include a simple comparison for equality, such as TAG=target, 
  2880. without
  2881.  alternatives: no OR, no tag list,  no target list.
  2882. whole
  2883.  of the field represented by TAG must be indexed.
  2884.  button
  2885.  on the 
  2886. Query panel
  2887.  must be set to agree with the index, i.e. it must be selected if the index is case-specific and deselected if not. That
  2888. s why the difference was produced by deselecting the 
  2889.  button 
  2890.  the index on GP isn
  2891. t case-specific so the query mustn
  2892. t be either.
  2893. 0,I    -P@
  2894. /    -P@
  2895. 0he    -
  2896. 2    -w7
  2897. 0p!    -
  2898. 0$7    -P@
  2899. o    -P@
  2900. D    - 7
  2901. 0(3    -
  2902. 0xj    -
  2903. * In this section we will often have occasion to refer to text typed by the user. Such text will be distinguished by the use of the Corpus Medium font, e.g.
  2904. Ch 4 
  2905.  Creating a New Database
  2906. Five steps are involved in setting up a new database:
  2907. Create the database 
  2908. application shell
  2909.          
  2910. Design the 
  2911. record layout
  2912.          
  2913. Specify the 
  2914. number of records
  2915.  the database is to contain.         
  2916. Specify the 
  2917. primary key
  2918. .         
  2919. Build the 
  2920. empty database
  2921. Creating the database application shell
  2922. You need to have 
  2923. Powerbase
  2924.  installed on the iconbar but with no database open, i.e. 
  2925. No data
  2926.  should appear under the icon. Click SELECT over the icon and a 
  2927. Save box
  2928.  will appear containing the default name 
  2929. !Database
  2930. . Type in the name of your database and drag the icon to a directory window. Remember that, for RISC OS versions prior to 4.00, the name cannot exceed 10 characters, including the initial 
  2931. . If you enter more the name will be truncated and you could end up overwriting an existing database with a similar name. You don
  2932. t actually need to enter the 
  2933. Powerbase
  2934.  will insert it automatically. 
  2935. If you are using RISC OS 4.xx on an E+ formatted hard-disc you will be able to use long filenames but, to do so in 
  2936. Powerbase,
  2937.  you will need to make a change in the 
  2938. !Powerbase.Resources.Config
  2939.  file. Look for the token 
  2940. NameLen
  2941.  and alter the number beside it to something bigger than 10. The change will take effect next time you run 
  2942. Powerbase.
  2943. If you open the newly-created application directory (Shift double-click) you will find that it contains four files (
  2944. !Run, !Sprites,
  2945. !Sprites22
  2946.  and 
  2947. Data) 
  2948. and six directories (
  2949. Indexes
  2950. Menus
  2951. PrintJobs
  2952. PrintRes
  2953. , UserFuncs
  2954. ValTables
  2955. ).  All databases expect these objects to be present so don
  2956. t delete any of them. 
  2957. Designing the 
  2958. record layout
  2959. When you created the application shell you were left with a window on screen, blank apart from a grid of blue lines, and it is here that you must design the database record. This is the lengthiest part of setting up a database, although efforts have been made to render it as easy as possible. If you have closed the window just click SELECT on the 
  2960. Powerbase
  2961.  icon on the iconbar to re-open it. 
  2962. 4.2.1
  2963. Simple 
  2964. field creation
  2965. Clicking MENU over the window brings up the 
  2966. New database
  2967.  menu on which every item except 
  2968. Create field
  2969.  and 
  2970. Grid 
  2971. is shaded at this stage. Choosing 
  2972. Create field
  2973.  displays the 
  2974. Field definition window
  2975.  which lets you specify the characteristics of a field. 
  2976. Grid 
  2977. allows you to choose options for the grid used to lay out the fields. This grid appears only in design mode, not in a working database (except when using the 
  2978. Adjust format
  2979.  and 
  2980. New record format 
  2981. features). It may be turned off but you will probably find it a help in getting the field layout as you want it.  There are options to choose the colour of the grid, whether it is represented by solid or dotted lines and what the spacing between the lines is.  By default the grid has solid, light blue lines spaced 32 OS units apart and  fields will 
  2982.  to it at intervals of 4 OS units. If you prefer settings other than the defaults 
  2983. Save choices
  2984.  will ensure that they are preserved next time you load 
  2985. Powerbase
  2986. . If you make further changes 
  2987. without
  2988.  saving them clicking 
  2989. Load defaults
  2990.  will recover your most recently-saved settings. You can return to 
  2991. Powerbase
  2992. original settings by Shift-clicking on 
  2993. Load defaults
  2994. First decide what class of field you want to create. There are eight such classes, selected via radio buttons: 
  2995. Editable
  2996. Computed
  2997. Scrollable list
  2998. Stamp
  2999. Check-box
  3000. Tool-pane button
  3001.  (or 
  3002. Keypad button)
  3003. External
  3004. Extra button
  3005. For the present we will confine ourselves to the first, which is the default selection. As well as the field class you must decide on the type of field within the class. The default offered is 
  3006. Unrestricted
  3007. , meaning that it will accept all printable characters. We
  3008. ll look at other types later. 
  3009. Decide on a name for the field and enter it in the 
  3010. Descriptor 
  3011. icon. This is the name which will appear on the 
  3012. record window
  3013.  and may be up to 40 characters long. You must also enter a 
  3014. , which is used to identify the field in 
  3015. search formula
  3016. e and is limited to 4 characters. Next enter the
  3017. Data length
  3018. ; the maximum number of characters the field is to hold. Values up to 246 are allowed. Now click on 
  3019. Create 
  3020. and the field will appear on the 
  3021. record window
  3022. s probably not where you want it so drag the white rectangle with SELECT to the position required. When you drop the field in its new position the 
  3023. descriptor
  3024.  falls into place too. If you want the 
  3025. descriptor
  3026.  somewhere other than to the left of the data icon (above it, for example)  move it by itself 
  3027. after 
  3028. positioning the data icon.  For fine adjustment re-open the 
  3029. Create
  3030.  window by double-clicking on the field and nudge the field into position using the bump icons at the bottom left corner.
  3031. To edit an existing field you can either click MENU over the field and choose 
  3032. Edit field 
  3033. or simply double-click SELECT over the field itself as above.  You can also display the data for any field by  choosing from the 
  3034. Fields Created
  3035.  submenu. This is also available from a menu button on the Field definition window.
  3036. After making changes click on 
  3037. Update 
  3038. Create 
  3039. will be shaded).
  3040. 4.2.2
  3041. Deleting, inserting and 
  3042. re-ordering fields
  3043. It is important to understand the difference between the 
  3044. physical position
  3045.  of fields on the screen and the 
  3046. internal numbering
  3047.  of the fields. The former is purely a matter of appearance and you may drag the fields about the screen to your heart
  3048. s content, but the latter is fundamental to the way the database will function.  Each field has a number which corresponds to the order in which it was created.  Whenever you invoke the 
  3049. Field Definition window
  3050.  the title-bar shows either the number of the (new) field you are about to create (e.g. 
  3051. New field 3
  3052. ) or the number of the (existing) field you were pointing at when you opened the menu (e.g. 
  3053. Modify field 5
  3054. ).  The numbering of fields determines the order in which they will be 
  3055. visited
  3056.  by the caret when you are actually using the database and typing Return to get from field to field, i.e. the editing order.
  3057. A field may be deleted by bringing it up for editing as described above and clicking on 
  3058. Remove field
  3059. . Fields which come after the deleted field will then be found to have had their field-numbers reduced by 1.  Inserting a field into the middle of the existing field-sequence is obviously a little more complicated because we have to specify where in the sequence the new field goes.  You need to know the number of the field which you want to follow the new one. This number is entered in the 
  3060. before
  3061.  icon before you click on 
  3062. Create
  3063. . The layout of this part of the window should make things clear: 
  3064. Create
  3065.  before <n>
  3066. . If you examine fields which come after the insertion you will see that their numbers have increased by 1.
  3067. You can change the numbering of a field by removing it and then re-inserting it, but  there is a better way.  Bring the field up for editing as previously described. We will call this the 
  3068. current field
  3069. . Enter the number of another existing field in the same place as was used above to specify the insertion position of a new field. We
  3070. ll call this the 
  3071. entered field
  3072. . You may then do one of the following:
  3073. Click 
  3074. Swap with
  3075. . This does exactly what you would expect. It swaps the positions of the current field and the entered field in the field sequence (but not their placement on-screen).
  3076. Click 
  3077. Renumber as
  3078. .  This is a bit more complicated. The current field acquires the number of the entered field. If this involves giving the current field a lower number than previously the fields beyond the new position are all moved up one place to open a gap for it, at the same time closing up the gap left by moving the current field from its old position. If it is being given a higher number the fields above its old position all move down one place, closing up the gap left by its removal and opening a gap in the required place farther up the sequence. (Once again, the physical position of the fields on the window is unchanged.)
  3079. 4.2.3
  3080. Moving and re-sizing the 
  3081. bounding box
  3082. Left to itself 
  3083. Powerbase
  3084.  makes all its field icons the same height and of a suitable length to contain the number of characters specified in 
  3085. Data length
  3086. . This may not be quite what you want. If the 
  3087. data length
  3088.  is large the field could run off the right edge of the window. You might also want to make the field taller for emphasis. (But 
  3089. for displaying multiple lines. Only fields of 
  3090. Text block
  3091.  type can be multi-line. These are discussed later.) 
  3092. We have already seen how you can alter the position of a field by dragging with SELECT. By dragging at an edge with ADJUST you can change the size of the bounding box.  
  3093. You can also specify both size and position by entering the required width and height of the bounding-box in the 
  3094.  and 
  3095.  icons and the co-ordinates of the lower-left corner 
  3096. in the 
  3097.  and 
  3098.  icons
  3099.  of the 
  3100. Field creation window
  3101. All these values are in OS units (the same units as are used for plotting to the screen) but the origin is the 
  3102. left corner of the 
  3103. record window
  3104. . This means that the Y values are always negative.
  3105. Clicking on 
  3106.  automatically sets the bounding-box width to fit the data length.
  3107. 4.2.4
  3108. More about 
  3109.  and 
  3110. descriptors
  3111. Tags are very important
  3112. Powerbase
  3113. . They are used when querying the database to produce reports, export 
  3114. CSV files
  3115.  etc. and also by some internal operations. Every printable field (see 
  3116. ) must have a tag and no two  tags can be the same. 
  3117. Descriptors
  3118.  are less important. They are there to provide visible labels for fields and in some cases you may not need one at all. e.g. You might want the record to look like this:
  3119. There are 5 fields here but, having given the second one the 
  3120. descriptor
  3121.  ADDRESS, you don
  3122. t really want 
  3123. descriptors
  3124.  for the remaining 3 (except perhaps POSTCODE for the last). It is quite in order to have null 
  3125. descriptors
  3126.  like this, but your 
  3127. must 
  3128. give each field a tag. Suitable ones might be NAME, ADD1, ADD2, ADD3, CODE. (Remember each must be unique and not more than 4 characters.)
  3129. omit the tag where the Data length is 0
  3130. . This allows you to create fields which are simply explanatory labels. Since there is no data in them there would be no reason to include them in a query. 
  3131. 4.2.5
  3132. Other types of Editable field
  3133. So far we have only used fields of Unrestricted type. Clicking on bump icons to the left of the field type, or on the menu button to the right, lets you cycle through the various types available. These are:
  3134. Unrestricted
  3135. Accepts any printable character.
  3136. Alphanumeric
  3137. Accepts all letters and numerals and common punctuation.  
  3138. Upper case
  3139. Accepts capital letters and numerals only. 
  3140. Numeric
  3141. Accepts numerals, +, 
  3142.  and . (decimal point).
  3143. Yes/No/Maybe
  3144. Accepts Y, N and ? only.
  3145. Date 
  3146. Accepts dates in the form dd-mm-yy or dd-mm-yyyy, checking 
  3147. that 
  3148. the date is valid and reporting an error otherwise. 
  3149. Accepts times in the form hh:mm:ss up to a value of 23:59:59.
  3150. time is checked for validity and errors are reported. 
  3151. Internet
  3152. Special field for email addresses and web URLs. There is no
  3153. restriction on character input, but double-clicking will call
  3154.  up your mail program or browser (if it has been 
  3155. the filer) with the address loaded.
  3156. When Numeric is selected, certain icons in the dialogue box which are normally shaded become available. Thus, you can specify floating-point, fixed-point or integer format by means of a group of radio buttons. You may also specify a maximum and 
  3157. minimum value
  3158.  for numbers which may be entered in these fields. The 
  3159. Numeric min
  3160.  icon is also used to hold the starting value for Sequence number fields (see 
  3161. 4.2.10
  3162. Date field
  3163.  should be either 8 or 10 characters long in order to hold the date in one of the two formats specified above. The hyphen separator in these dates may be changed via the 
  3164. Preferences window
  3165.  (see 
  3166. 14.1.2
  3167. ).  Powerbase is very tolerant of the way you actually enter a date. You may type 
  3168. non-numeric character as a separator: 
  3169. Powerbase
  3170.  will make sense of an entry such as 4/5/87, converting it to 04-05-87 when you type Return. Arithmetic may be performed on dates held in this type of field, e.g. you could have a Calculated field subtract the contents of two Date fields and display the difference in days (see 
  3171. 6.1.5
  3172. Time fields
  3173.  also allow flexibility in how you enter the values. If you enter 3.45;9 it will be reformatted as 03:45:09. The colon separator may be changed via the 
  3174. Preferences window
  3175.  (see 
  3176. 14.1.2
  3177. ). You may also enter incomplete times which are, by default, interpreted as follows. A number entered on its own is treated as hours. Thus, if you enter 6 and type Return it will be reformatted as 06:00:00. Two number separated by a non-numeric character are treated as hours and minutes, e.g. 6/5 would be reformatted as 06:05:00. You may edit 
  3178. Powerbase
  3179. s Config
  3180.  file to reverse this behaviour so that 6 is formatted as 00:00:06 and 6/5 as 00:05:06. When using this mode of entry you may also suppress the hours part of the display for values less than an hour, e.g. so that 6/5 is formatted as 05:06. (See 
  3181.  for editing 
  3182. Config.
  3183. Like Date fields, Time fields may be included in calculations, e.g. to obtain the difference in seconds between two times or to average a number of times (see 
  3184. 6.1.4
  3185. 4.2.6
  3186. Scrollable lists
  3187. These are also user-editable but are treated separately because they are like no other editable field.  They are intended for record structures which contain closely-related data items whose number might vary widely from one record to another. A music CD, for example, might have only 3 or 4 tracks but it could have 30 or more. If you are cataloguing CDs and including track information you don
  3188. t really want to define 30 separate fields to allow for just a few extreme records 
  3189.  and find even then that the odd disc has more than 30 tracks! A scrollable list lets you make allowance for a modest number of items, adding new ones as required for individual records. Since the list is scrollable it occupies no more space on the record window no matter how many items are in the list.
  3190. When the Scrollable list radio button is selected an extension appears at the bottom of the Field definition window. This contains writable icons to enter the number of rows of the list which will be visible and the number of characters to be accommodated in each column. The list may have from 1-4 columns. 
  3191. On clicking 
  3192. Create
  3193.  all that will be seen is a grey rectangle. 
  3194. Powerbase
  3195.  has calculated the height of this rectangle so that it will display exactly the number of rows you entered, and the width from an 
  3196. intelligent guess
  3197.  at how much room will be needed for the specified numbers of characters when rendered in the desktop font. It
  3198. s best to leave the size of the rectangle alone, but move it to where you want it, of course. When the working database is created you will see the Scrollable list in all its glory.
  3199. The data contained in Scrollable lists is not held in the 
  3200. Database
  3201.  file. Data for each record is in a separate file stored in a special system of subdirectories inside the database directory. In this they resemble External fields (see 
  3202. 4.2.8
  3203. 4.2.7
  3204. Check-box
  3205.  fields
  3206. These are fields whose status changes when clicked on with SELECT. Eight types are defined:
  3207. Cross/tick
  3208. Displays a cross initially. A click changes it to a tick. 
  3209. A second click 
  3210. changes it back to a cross. 
  3211.         
  3212. Null/tick
  3213. Similar to (a), but initial state is an empty box.         
  3214. Null/star
  3215. Similar to (b), but second state is a star.
  3216. Option button
  3217. Exactly like the square option buttons seen on dialogue boxes.
  3218. Radio button
  3219. Exactly like the round radio buttons seen on dialogue boxes
  3220. Null/tick/cross
  3221. This is a 
  3222. three
  3223.  state check-box the first state being an empty box.
  3224. Repeated clicking cycles through tick, cross and back to 
  3225. empty box.
  3226. ?/tick/cross
  3227. Another 
  3228. three-state check-box
  3229.  where the first is a question mark.
  3230. Null/Male/Female
  3231. Yet another three-state box whose states are empty box, M and F.
  3232. Check-box
  3233. es provide the fastest way of entering true/false or yes/no type data and the 3-state types allow for yes/no/undecided situations. 
  3234. If you examine the file 
  3235. Powerbase.Resources.
  3236. ValStrings
  3237.  you will find strings associated with each of these five types the latter parts of which read, respectively:
  3238. QNo,Yes
  3239. Q-,Yes
  3240. Q-,Yes
  3241. Q-,Yes
  3242. QNo,Yes,-
  3243. QNo,Yes,?
  3244. QFemale,Male,-
  3245. These specify what will actually appear in a print-out when a 
  3246. check-box
  3247.  field is included in a report (see 
  3248. ). You may change them if you wish, but don
  3249. t omit the initial Q (although this will 
  3250.  appear in the print-out) and take care not to alter other parts of the string.
  3251. 4.2.8
  3252. External field
  3253. External field
  3254. s allow you to link 
  3255. Powerbase
  3256.  records to pieces of data of a size and type which make them unsuitable for inclusion in an Editable field. Such items are sometimes called 
  3257. BLOBs
  3258. Binary Large OBjects
  3259. ) in the PC world. The field types in this class and the types of data linked to them are as follows: 
  3260. Plain 
  3261. text files
  3262. , such as 
  3263. Edit 
  3264. creates.
  3265. Sprite
  3266. Sprite files
  3267. , such as 
  3268. Paint 
  3269. creates.         
  3270. Drawings such as 
  3271. Draw 
  3272. creates.
  3273. Text block
  3274. Plain text files, as for (a). 
  3275. Picture
  3276. Sprite files, as for (b).
  3277. Remote
  3278. Anything!
  3279. When you create a field of type Text, Sprite or Draw it appears on the 
  3280. record window
  3281.  as a button bearing a small version of the icon for 
  3282. Paint 
  3283. Draw 
  3284. respectively. Files of the appropriate type may be dropped on these buttons, whereupon the file is copied into a special system of subdirectories within the database application. Unlike fields of the Editable class the data doesn
  3285. t become part of the 
  3286. Database 
  3287.  within the application (see also 
  3288. 4.2.6
  3289. ); the Text, Sprite or 
  3290. Draw file
  3291.  retains its identity and may be exported for editing in the appropriate application. Clicking on the button in the 
  3292. record window
  3293.  will display the file if the filer knows the whereabouts of the relevant editor (
  3294. Paint 
  3295. Text block
  3296.  and 
  3297. Picture
  3298.  fields take things a step further by actually displaying a text or sprite file on the 
  3299. record window
  3300. . The bounding box of the icon needs to be of suitable size to hold the text or sprite. In the case of a 
  3301. Text block
  3302.  too small a box will cause the text to appear truncated. None is actually lost; it just can
  3303. t all be displayed. Too small a box for a 
  3304. Picture
  3305.  field will cause the sprite to spread beyond its boundaries. (N.B. To display the 
  3306. same 
  3307. sprite on each record, e.g. a company 
  3308. , define the field as of type 
  3309. , not 
  3310. Picture
  3311. .)  The contents of a Text block or Picture field can be loaded into 
  3312. Paint
  3313.  by double-clicking with SELECT.  When the edited text or sprite is saved the 
  3314. Powerbase
  3315.  field will be seen to update.
  3316. To break the link between the button and the External object choose 
  3317. Unlink file
  3318.  from the 
  3319. Field
  3320.  submenu.
  3321. 4.2.9 
  3322. Remote fields
  3323. These demand a special section to themselves. They allow 
  3324.  type of filer object (file, directory or application) to be linked to a button on the record window. They differ from Text, Sprite, and Draw buttons in that the linked object is 
  3325. copied into the database directory: the object remains in its original position in the filing system and only its 
  3326. pathname 
  3327. is stored to provide a link between database record and object. Hence the term 
  3328. Remote
  3329. . This has both advantages and disadvantages. Because no copy is made disc space is saved and the database stays a manageable size; an important factor where large sprites or JPEGs are involved.
  3330. A Remote button normally shows a large, down-pointing arrow inviting the user to drop an object onto it. It will accept files of any type, ordinary directories or applications. Once a link is established the button shows the appropriate file icon or a blue folder or the default application icon. A single click has the same effect as double-clicking the object in a filer window: directories are opened, applications are run, files are loaded into their applications, Obey files and BASIC programs are executed. If the linked object can
  3331. t be found 
  3332. Powerbase 
  3333. will be aware that something used to be there and the button will display a question mark.
  3334. Pathnames of Remote objects
  3335. The stored pathnames may be either 
  3336. absolute
  3337. relative
  3338. , that is relative 
  3339. to the database
  3340. .  Which is used depends upon a setting in the 
  3341. Config
  3342.  file, which may be the file in 
  3343. !Powerbase.Resources
  3344.  or a 
  3345. private
  3346. Config
  3347.  file stored inside the database directory. Look for the token 
  3348. Pathlen
  3349. , beside which is a number (normally 255) followed by a letter: either 
  3350. . If the letter is omitted altogether 
  3351.  (for 
  3352. elative pathnames) is assumed. Relative pathnames are only possible when the files are on the same disc as the database: otherwise Absolute pathnames are used even when not configured.
  3353.   Consider the file structure opposite. The directory called 
  3354. Pictures 
  3355. holds a collection of JPEG images (sub-divided into several categories), each image being associated via a Remote button with a record in the 
  3356. !MyPhotos
  3357.  database. 
  3358. The full pathname of the JPEG 
  3359. Horse 
  3360. ADFS::HardDisc4.$.FredsData.Pictures.Animals.Horse
  3361. If you drop the JPEG file onto the Remote button and either the database or 
  3362. Powerbase
  3363.  itself is configured for 
  3364. bsolute pathnames, this is what will be stored. Everything is fine as long as the JPEG remains in the same directory on the same hard disc.
  3365. But what happens if you decide to transfer your photo collection to CD ROM? The old pathname of the JPEG is no longer valid! Even if you transfer the whole of the above structure from the root directory down, the pathname will be different because the data is no longer on an ADFS disc called HardDisc4. On opening the 
  3366. !Photos
  3367.  database you will find the Remote button sporting a question mark instead of the JPEG icon. Clicking on the button is without effect: 
  3368. Powerbase
  3369. t find the file on your CD because it still thinks the pathname should be the one beginning:
  3370. ADFS::HardDisc4.$.FredsData.
  3371. There is, however, a way of making this transfer to a different medium quite painless and that is to use 
  3372. elative pathnames. On the original hard disc the absolute pathname of the database was:
  3373. ADFS::HardDisc4.$.FredsData.Databases.!MyPhotos
  3374. If you compare this with the original pathname for 
  3375. Horse 
  3376. ll see that
  3377. the first sections of both pathnames, as far as and including 
  3378. FredsData
  3379. , are identical and this enables us to locate 
  3380. Horse 
  3381. without using its full pathname. 
  3382. Powerbase 
  3383. does, of course, know the full pathname for 
  3384. !MyPhotos
  3385.  when the database is open so it can find 
  3386. Horse 
  3387. by, in effect, saying: go up two levels in the disc tree from the database, then use:
  3388. Pictures.Animals.Horse
  3389. But how do we let 
  3390. Powerbase 
  3391. know it needs to go up two levels? The character 
  3392. , included as an element in a pathname, is an instruction to go up one level. What needs to be stored for the example given above therefore is:
  3393. ^.^.Pictures.Animals.Horse
  3394. which is the pathname 
  3395. relative 
  3396. !MyPhotos
  3397. . When 
  3398. Powerbase 
  3399. reads this all it needs to do is prefix it with the already-known pathname for 
  3400. !MyPhotos
  3401.  and the JPEG 
  3402. Horse 
  3403. can be retrieved.  If the directories 
  3404. Databases 
  3405. (containing 
  3406. !MyPhotos
  3407. ) and 
  3408. Pictures 
  3409. (containing the subdirectory 
  3410. Animals
  3411. ) were transferred to the root directory of a CD ROM named PICLIB the pathnames of 
  3412. Horse  
  3413. !MyPhotos
  3414.  would be:
  3415. CDFS::PICLIB.$.Pictures.Animals.Horse
  3416. and:                                         
  3417. CDFS::PICLIB.$.Databases.!MyPhotos
  3418. If the relative pathname has been stored, as described above, it will still be valid: it
  3419. s still a matter of going up two directories (thus reaching the root) and then working down from there. You don
  3420. t, of course, have to work out the relative paths yourself! 
  3421. Powerbase
  3422.  does it all for you when you drop a file on a Remote button provided 
  3423. elative paths are configured.
  3424. So which should you use; absolute or relative pathnames? There are advantages and disadvantages to both. Absolute pathnames are appropriate if the Remote objects are unlikely to be moved and, especially, if the same database is associated with objects on several different discs or filing systems. The database itself can be moved anywhere you like without affecting 
  3425. Powerbase
  3426.  ability to retrieve the data. Relative pathnames are more appropriate if the Remote objects are organised in a closely-related set of directories on one disc, especially if you intend to move the whole collection. It is, however, important to maintain the same relative positions between the objects and the database at all times.
  3427. Relative pathnames may be globally converted to absolute ones using 
  3428. Miscellaneous=>
  3429. Convert paths
  3430. Where files are on the same disc as the database it is also possible to convert absolute to relative pathnames. Any which cannot be converted will be recorded in a file 
  3431. NoCanDo
  3432. PrintJobs 
  3433. along with the record numbers. A window is displayed showing the configured setting (which is not changed by the conversion) and radio buttons to select the type of conversion required. The Query panel is also present enabling you to target specific groups of records and select the subfile(s) to be searched. Confirmation is required before conversion proceeds. 
  3434. A Remote button may be highlighted with ADJUST in order to include the stored pathnames in a report. You can examine the pathname of an object by clicking Shift-ADJUST on the button.
  3435. 4.2.10 Auto-displaying External files
  3436. The Field definition window has a 
  3437. Display
  3438.  button which is shaded for all except External fields. If you select this, and if an application for loading and displaying the file is known to the filer, then every time a record is displayed the associated External file will be displayed without the need to click on the button. This makes it possible, for example, to run a 
  3439. slide show
  3440.  of linked images by clicking the 
  3441.  button on the tool-pane. Thomas Olsson
  3442. s PD application 
  3443. EasyView
  3444.  is very fast at rendering JPEGs and doesn
  3445. t open separate windows for successive JPEGs. This makes it very suitable for this type of application. 
  3446. You needn
  3447. t decide at the field-creation stage whether you want auto-display or not: you can always set the option later. The feature may also be toggled on and off by clicking the button with Ctrl-ADJUST.
  3448. 4.2.11 
  3449. Computed fields
  3450. Discussion of Computed fields is postponed to 
  3451. Ch 6 
  3452.  Performing Calculations.
  3453. 4.2.12 
  3454. Stamp field
  3455. Stamp field
  3456. s resemble Computed fields in that you cannot edit them; 
  3457. Powerbase
  3458. stamps
  3459.   the fields with the appropriate contents automatically. The following types are available:
  3460.        
  3461. Sequence number
  3462. Unique value numbered from a base value set by the user.
  3463. Record number
  3464. Database record number.  
  3465. Time 
  3466. Time at which record was created.        
  3467. Date  
  3468.          
  3469. Date on which record was created.     
  3470. Date and time
  3471. Date and time of record creation.         
  3472. Day (of week, month or year) on which record was created. 
  3473. Month
  3474.       
  3475. Month in which record was created. 
  3476. Year   
  3477. Year when record was created.
  3478. Last altered
  3479. Records the date and time record is first created and updates it
  3480. only if the record is subsequently altered. Merely displaying 
  3481. the record does 
  3482. cause updating.         
  3483. Allows a sprite to be included as a 
  3484.  on  every record.
  3485. Frame
  3486. Used to enclose groups of fields to clarify layout.
  3487. These fields are stamped by 
  3488. Powerbase
  3489.  when a record is first entered and thereafter, with the exception of (i), stay fixed.  (But see 
  3490.  for similar types of field which auto-update.)
  3491. Sequence numbers
  3492. The base value from which sequence numbers begin is entered in the 
  3493. Numeric min
  3494.  box. Every time a new record is added the Sequence number is incremented. Be sure to set the field-length so that the biggest number envisaged can be accommodated. When a record containing such a field is deleted the sequence number is 
  3495.  normally re-used; a new record is given a new sequence number.  This leads to gaps in the numeric sequence and you might want to reassign the numbers so that the sequence is continuous.  You can do so by means of 
  3496. Compact sequence
  3497. from the 
  3498. Field
  3499.  submenu. Before this can be used the sequence number field must be 
  3500. indexed
  3501.  and selected as the 
  3502. current 
  3503. index.
  3504. The base value of sequence numbers may be reassigned by choosing 
  3505. Set base value
  3506.  from the 
  3507. Field
  3508.  submenu. The new value must be larger than the largest sequence number currently in use.
  3509. Record number 
  3510. requires no further comment.
  3511. Time 
  3512. is in hh:mm:ss format. The colon separator may be changed in 
  3513. Preferences
  3514. Dates 
  3515. can be in one of three formats: 
  3516. Date 8
  3517. displays the date as DD-MM-YY. The separator may be changed in 
  3518. Preferences. 
  3519. When such dates are used in calculations (see 
  3520. 6.1.5
  3521. ) years <=10 are treated as 21st
  3522. century and others as 20th century. This 
  3523. turnover
  3524.  point may be altered by editing 
  3525. the number beside the 
  3526. CentChange
  3527.  token in the 
  3528. Config 
  3529. file.
  3530. Date 10
  3531. displays the date as DD-MM-YYYY.
  3532. Long date
  3533. displays the date as (e.g.) Sun,01 Aug 1993
  3534. Date and time
  3535.   uses the format: Tue, 10 Aug 1999.21:18:36 (identical to the Real-time clock).
  3536. day of week
  3537.  may be expressed as a numeral (1-7) or textually, either in short form (Mon, Tue etc.) or in full (Monday, Tuesday etc.). Day of month and Day of year are always numbers.
  3538. Month
  3539.   may be a  numeral (1-12), in short form (Jan, Feb etc.) or in full (January, February) etc.
  3540.  is always a 4-digit number.
  3541. Last altered
  3542.  is displayed in the same format as Date-and-time
  3543. Logos
  3544. require the name of the sprite to be entered as the tag of the field to be used as a 
  3545. . This means that the sprite name is limited to four characters. The icon for a Logo field (like that of a Picture field) must be large enough to hold the intended sprite. You may have several 
  3546.  fields on your record, all the required sprites being included in a sprite file called 
  3547. UsrSprites
  3548. which is placed inside the database directory.
  3549. Frames
  3550. may be of either 
  3551. Channel
  3552. Ridge
  3553.  type, both of which are familiar objects on RISC OS dialogue boxes. 
  3554. Be careful how you use them. You should define the frame 
  3555. before
  3556.  defining the Editable or Button fields which it encloses, otherwise you won
  3557. t be able to get at these because they are 
  3558. behind
  3559.  the frame even though the latter is  transparent. If a frame is to be given a heading this too needs to be defined after the frame or the channel/ridge will run through the middle of the text. Use a field of Unrestricted type with a descriptor only and a zero data length. This can be dragged to a position where it overlays part of the top of the frame. (You can
  3560. t simply give the frame itself a descriptor and drag that into position because the descriptor has an earlier icon number than the frame and the frame will cut across it as described above.)
  3561. 4.2.13 
  3562. Button field
  3563. Any or all of the control buttons on the 
  3564. Powerbase
  3565. tool-pane
  3566. keypad
  3567.  may be made to appear on the 
  3568. record window
  3569.  itself. They are chosen from the 
  3570. Tool-pane button
  3571.  menu and have exactly the same functions as they do on the tool-pane. These 
  3572. button field
  3573. s let you build a customised database which allows the user to use only the features you want him/her to have access to since the tool-pane/
  3574. keypad
  3575.  and menus can then be suppressed (see 
  3576. ). There is also a group of 
  3577. Extra buttons
  3578.  which can 
  3579.  appear on the record window:
  3580. Print 
  3581. brings up the 
  3582. Match window
  3583.  for report printing.
  3584. duplicates the action of 
  3585. Close database
  3586.  on the iconbar menu.
  3587. Quit 
  3588. duplicates the action of 
  3589.  on the iconbar menu.
  3590.  buttons
  3591.  are of two types. 
  3592. The first associates a specific data field with a 
  3593. pop-up menu
  3594. .  Clicking the button with SELECT and choosing a character string from the menu enters it into the data field, overwriting the previous contents. To associate the menu button and data field they are given 
  3595. the same tag: 
  3596. one of the very few cases where this is allowed. 
  3597. The menu data is stored in a text file whose name is the tag of the associated data field plus the word 
  3598. . When you click on the Menu button for the first time the text file is loaded for editing. The first line of the file reads 
  3599. UserMenu
  3600.  and you should change this to whatever title you want to use. If you leave it as UserMenu you will always be presented with the text file instead of an actual menu when you click SELECT on the button. Each menu choice must be placed on a separate line after the title. Save the file.
  3601. The second type of menu button is not linked to a specific field and must be given a 
  3602. unique 
  3603. tag. It is a 
  3604. general menu button
  3605.  which may be used to insert strings into any Editable or Scrollable list field and is distinguished from the previously-described 
  3606. field menu button 
  3607. by being darker grey. In use, it inserts data into the field which contains the caret. Moreover, the data is inserted 
  3608.  the caret without overwriting whatever is in the field already.
  3609. All user-menu files are stored in the 
  3610. Menus
  3611.  subdirectory
  3612.  inside the database directory. To modify a menu just click on the Menu button with ADJUST, which loads the menu file for editing.
  3613. User menus of the 
  3614. field
  3615.  type pop up automatically when the caret enters the associated data field. This behaviour can be disabled from the 
  3616. Preferences
  3617.  window.
  3618. Directory
  3619. In its initial state this button displays the small directory icon. Dropping a directory onto it changes this to a large directory icon and clicking on the button opens a filer window on the directory. This type of button does 
  3620.  enable you to associate a different directory with each record: if you want to do that you need a Remote field. A Directory button is merely a convenient way of having a frequently-used directory always available, regardless of what record is displayed. 
  3621. The pathname of the directory may be 
  3622. absolute
  3623. relative
  3624.  and is determined by the same 
  3625. Config
  3626.  option as for Remote fields (see 
  3627. 4.2.9
  3628. ). Two other 
  3629. Config
  3630.  options are relevant. 
  3631. DirOpts
  3632.  determines how the directory is displayed, the default being with small icons and alphabetic sorting.  
  3633. ButtonAtts
  3634.  enables the directory name to appear beneath the button. These features are fully described in 
  3635. .The link between button and directory may be broken in the way already described for External fields.
  3636. Run file 
  3637. This type of button displays an icon made up of four different filetype icons. When you drop a file onto the button the icon changes to that of the relevant file and subsequent clicks on the button will run the file. Text files are treated as 
  3638. Powerbase
  3639.  scripts (see 
  3640. Ch 12
  3641. ), other types of file (e.g. Obey files) have their normal Run action. As in the case of the Directory button, this does not permit different files to be linked to different records; it
  3642. s always the same file whatever record is displayed. Filenames are, again, either absolute or relative and the 
  3643. ButtonAtts
  3644.  option in 
  3645. Config
  3646.  applies to this button too. Unlinking the file is performed exactly as for the Directory button.
  3647. Increment
  3648.  The simple task of increasing or decreasing a number in a field by a fixed amount can be a bit of nuisance to do manually, especially if several records are involved, so a button to do it with a single click is provided. Like the Menu button, the link to the data field (which must be Editable but need not be defined as Numeric) is supplied by giving it the same tag.  Whatever you type in the 
  3649. Descriptor 
  3650. icon will appear as a legend on the button and, if you leave 
  3651. Descriptor 
  3652. blank, the default legend 
  3653. Increment
  3654.  will be used. The default increment is +1 and may be altered via 
  3655. Increment size 
  3656. on the 
  3657. Field
  3658.  submenu.
  3659. Evaluate
  3660.  is set up in much the same way as Increment, i.e it is given the same tag as an Editable field and the descriptor is used as a legend (default is 
  3661. Evaluate
  3662. ). The button is used to enter the result of a calculation into its associated data field and further discussion is postponed until 
  3663. 4.2.14 
  3664. Mandatory fields
  3665. This isn
  3666. t yet another class of fields. A mandatory field is one which 
  3667.  be filled in before you can access another record or close the database. It has already been noted that at least one of the primary key fields must not be blank (see 
  3668. 2.4.1
  3669. ), but any Editable field (but not Scrollable list) can be made mandatory by selecting the 
  3670. Must not be blank
  3671.  option button when designing the field. Such fields appear on a working database with red as the foreground colour. (This may be altered via the 
  3672. Colours window
  3673. ; see 
  3674. A short-cut to a working database
  3675. The third item on the 
  3676. New database
  3677.  menu is called 
  3678. Default database
  3679. . Choosing this is by far the quickest way of getting a database up and running. Its action is to create three files inside the application directory. These are called 
  3680. Form 
  3681. (which holds the record design), 
  3682. PrimaryKey
  3683. Database 
  3684. (which will ultimately contain the entered records). The number of records in the database is set to 100, with 25 as the amount by which this should increase when the database becomes full. The 
  3685. primary key
  3686.  is defined as the first four characters of the first 
  3687. Editable field
  3688. . The database is opened and a blank record displayed ready for data entry.  Since you can alter all the above characteristics later, you might wish to use these defaults while you experiment with the database. If you want to choose the 
  3689. database size
  3690.  and primary key structure yourself follow the procedure in Sections 
  3691.  and 
  3692. Specifying the 
  3693. database size
  3694. This involves two steps:
  3695. Save the 
  3696. Form 
  3697.  (which contains all the field data). The 
  3698. Save form file
  3699.  menu entry leads to a standard Save box but, since the pathname is correctly set for saving the file inside your database application, all you actually need do is click on the menu item itself. 
  3700. You will now see that the 
  3701. Database size
  3702.  choice is no longer shaded and may be used to reach the Size window in which you specify the number of records in the database and the increment for expanding the database when it becomes full. 
  3703. Specifying the 
  3704. primary key
  3705. 4.5.1
  3706. General procedure
  3707. Click MENU and choose 
  3708. Primary key
  3709.   This opens the 
  3710. Key Structure
  3711.  window. The 
  3712. primary key
  3713.  (or any other key) is derived from one or more record fields called 
  3714. key field
  3715. s. Up to four 
  3716. key field
  3717. s may be used to define a key but we will begin by using just one.  Four pieces of information need to be specified:
  3718. Choose the 
  3719. field
  3720. , either by clicking on the bump icons or choosing from the associated pop-up menu.  The default is the first Editable field in the record.
  3721. Enter the 
  3722.  within the field from which characters are to be taken to make up the key.  The default is word 1.  If 0 is entered word boundaries are ignored (see 
  3723. 4.5.2
  3724. Enter the 
  3725. position
  3726.  within the word from which characters are to be taken. L (default) means from start of word, R means take from end.  A number (
  3727. ) means start at the 
  3728. th character.
  3729. Enter the number of characters to be taken from the word. The initially-set value is 4 but thereafter the default is the defined field length. 
  3730. After entering this information click on 
  3731. Create
  3732.  and the empty 
  3733. Database 
  3734. PrimaryKey
  3735.  files will be created, after which the database will open ready for you to start entering records.
  3736. 4.5.2
  3737. Some illustrative examples
  3738. Key field
  3739. s should be chosen with care. An ideal 
  3740. key field
  3741.  is one whose contents would never be repeated in another record. 
  3742. Powerbase
  3743.  lets you enforce this condition if you wish (see 
  3744. 11.2.1
  3745. ) but the default setting allows key duplication. Occasional repetitions may not be serious, but a field which can have only a few 
  3746. values
  3747.  is usually a poor choice. A customer number or membership number is the sort of thing we are looking for but your database may not contain anything like that.  In a database of school pupils the pupil
  3748. s name would be a good choice of key, but the form teacher
  3749. s name would not, since only a small number of names would be involved, each appearing on the record of many pupils. 
  3750. Suppose you decide to use a person
  3751. s name, stored surname first, in a single field whose tag is NAME, as a key. You could use the whole name but it would probably be too long. The first four letters would be more appropriate but, as this is the start of the surname, you might get a lot of duplication. e.g. PRESTON and PRESCOTT would both have the key PRES; and this is before we even consider people whose surnames are identical. To get round this problem, 
  3752. Powerbase
  3753.  lets you construct an alphanumeric key from characters taken from up to 
  3754. four 
  3755. successive words. You will seldom need to go so far. In the present case a five-letter key made up from the first four letters of the surname and one letter of the forename would be good enough for most purposes. 
  3756. Set up the 
  3757. Key Structure
  3758.  window as follows:
  3759. Field
  3760. Chars
  3761. Position
  3762. 1st row:
  3763. 2nd row:
  3764. This works quite well.  Smith Peter and Smith Janet would have the 
  3765.  SMITP and SMITJ. Duplication can still occur, but not often enough to be a serious problem.
  3766. Further examples illustrate the use of letters from different parts of words in the key field.  The following settings of 
  3767. position 
  3768. characters
  3769.  would produce the 
  3770.  shown from the name Herring Albert.  (a)
  3771. (d) use the Surname only, (e) and (f) use the Forename only, the rest use both names:
  3772. rom Surname
  3773. From Forename
  3774. Chars
  3775. Chars
  3776. HERRI
  3777. RING (stops at word end)
  3778. HERRALBE
  3779. ALBING
  3780. RINER
  3781. GALBERT  (ignores breaks)
  3782. RINGAL     (ignores breaks)
  3783. Take particular note of what happens if the word number is entered as 0 (or left blank).  All breaks between words are then ignored.  The field is treated as if the blanks between words had been removed leaving a single long word which is then subjected to the process specified by the position and characters icons.  When, on the other hand, the word number is 1 or greater the scanning for characters stops when the end of the word is reached so that the key might be shorter than the character length specified. Example (d) illustrates this. 
  3784. 4.5.3
  3785. Using 
  3786. more than one field in a key
  3787. You might, of course, want to store surname and forename in 
  3788. different 
  3789. fields. Let
  3790. s call their 
  3791.  SNAM and FNAM.  To produce the five-letter keys given in our first example the key definition would be:
  3792. Field
  3793. Chars
  3794. Position
  3795. 1st row:
  3796. 2nd row:
  3797. and the 
  3798.  generated will be exactly the same as they would be for the single field NAME.
  3799. There are databases where no single field is suitable for constructing the 
  3800. primary key
  3801. .  In a database of classical music, for example, there would probably be one field for the composer
  3802. s name and one for the name of the work. Neither is much use individually; the former could contain many occurrences of Mozart or Beethoven and the latter many repetitions of Symphony No. 5 or String Quartet in D minor. 
  3803. This is the kind of situation where you might want to use two fields and as many as four words, taking one word from the Composer field and three from the Work field using, say, 4, 3, 3 and 2 characters respectively from them. The following work would then yield the key shown on the right:
  3804. BEETHOVEN Symphony No. 5
  3805. BEETSYMNO.5
  3806. This is less than ideal: part of the key (NO.) conveys no useful information. The problem is even more acute in the following case:
  3807. MOZART Piano concerto No. 23
  3808. MOZAPIACONNO
  3809. The number is the 
  3810.  and forms no part of the key: 
  3811.  Mozart
  3812. s piano concertos would have the same key! What we really want to do is ignore insignificant words like 
  3813.  when constructing keys. We can do so by entering a list of the words to be ignored in the 
  3814. Ignore
  3815.  icon on the 
  3816. Key Structure window
  3817. , using commas to separate the words. If we enter 
  3818. No.,A,The,the,of
  3819.  in the Ignore field the works mentioned above would be given the keys:
  3820. BEETSYM5
  3821. MOZAPIACON23
  3822. An entry such as MAHLER The Song of the Earth would yield the key MAHLSONEAR, and BRITTEN A Ceremony of Carols would give BRITCERCAR.
  3823. Additions and alterations to the 
  3824. Ignore
  3825.  list and 
  3826. Split characters
  3827.  list (see below) can be made at any time by choosing 
  3828. Index=>Show details
  3829. Ctrl K
  3830. ) from the main menu. Click 
  3831. Modify
  3832.  after making changes.
  3833. 4.5.4
  3834. Further refinements
  3835. We can do even better. It is more natural to write 
  3836. No.23
  3837.  (no space) than 
  3838. No. 23
  3839.  but, so far, we have regarded only the space character as a word-separator. If we can make the field split at characters such as full-stop, hyphen, comma, semicolon and colon the key structure will be much more versatile. We can achieve this by entering the required 
  3840. Split characters
  3841.  as a string, i.e.  
  3842. .-,;:
  3843. Where numerals form part of the key, but the key isn
  3844. t wholly numeric* there can be a problem with the ordering in the index and hence the order of records in a report. The problem would be particularly bad if we were cataloguing all Haydn
  3845. s 104 symphonies. Using the key structure devised earlier this would involve keys such as: 
  3846. HAYDSYM102,  HAYDSYM17,  HAYDSYM45,  HAYDSYM6
  3847. Surely that
  3848. s not the order they should be in? It isn
  3849. t, but that
  3850. s the order we
  3851. d get! The reason is that the computer doesn
  3852. t regard numerals
  3853.  in a character string as anything special. They are merely characters, no different from letters and punctuation. Each character is represented internally by a number called the ASCII
  3854.  code and the ordering of characters is determined by these codes. Any string of numerals beginning with 
  3855.  therefore comes before one beginning with 
  3856. , even though the strings might be 1000 and 20. There is a way round this problem and that is to pad all our numbers to the same length by adding spaces to the 
  3857.  of the string. 
  3858. Powerbase
  3859.  will do that for you in keys if you select 
  3860. Justify numbers
  3861.  Pad with spaces
  3862. ! That adds spaces to the 
  3863. .) The four keys shown above will then come out as follows:
  3864. HAYDSYM  6
  3865. HAYDSYM 17
  3866. HAYDSYM 45
  3867. HAYDSYM102
  3868. and will appear in the correct order because the ASCII code for a space is less than that of any numeral. Corpus font is used so that the justification of the numbers is clearly visible.)
  3869. 4.5.5
  3870. Other matters concerning keys
  3871. You will have observed that a word shorter than the number of characters specified is used just as it is, resulting in a short key. There might be times when you want short words padding out with spaces to give a key of full length and selecting 
  3872. Pad with spaces 
  3873. in the 
  3874. Key Structure
  3875.  window will do so by adding the requisite number of spaces to each section of the key. Don
  3876. t confuse this with 
  3877. Justify numbers
  3878.  (see 
  3879. 4.5.4
  3880. Another factor to be decided is whether the 
  3881. index
  3882. ing is to pay attention to the case of letters, i.e. if they are capitals or small letters By default 
  3883. index
  3884. ing is 
  3885. case-sensitive. Thus if a record has the word 
  3886. Horse
  3887.  as the contents of a 
  3888. key field
  3889.  and the first four letters are used as the key then the entry in the 
  3890. index
  3891.  will be 
  3892.  and you may search for it by entering 
  3893.  etc.
  3894. This may not be what you want. If you require 
  3895. index
  3896. ing to be case sensitive select the button labelled 
  3897. . Forcing to upper case as described above does not then take place: 
  3898.  are inserted and strings are searched for 
  3899. as is
  3900. . The field containing 
  3901. Horse
  3902.  will be 
  3903. index
  3904. ed as 
  3905.  and only that precise combination of upper and lower case letters will successfully find it. 
  3906. Alphanumeric 
  3907.  will be ordered according to the ASCII values of the letters. Since lower-case letters come later in the ASCII table than upper-case ones a record containing 
  3908.  would appear 
  3909. after
  3910.  one containing 
  3911. Horse
  3912. , whereas one containing 
  3913.  would come before 
  3914. Horse
  3915. Omit null keys 
  3916. is shaded at this stage since null primary keys are not allowed. Only if you create a subsidiary key do you have to decide whether to include nulls in the index or not.
  3917. Building the empty database
  3918. Once you are satisfied click 
  3919. Create
  3920.  and blank 
  3921. Database
  3922.  and 
  3923. PrimaryKey 
  3924. files will be created. The 
  3925. record window
  3926.  is redrawn and you may start entering data at once. 
  3927. Renaming a database
  3928. Use the 
  3929. Rename database 
  3930. option on the 
  3931. Miscellaneous 
  3932. submenu to do this.  If you rename via the filer your database will lose its 
  3933.  icon and revert to the default application icon. 
  3934. Rename database
  3935.  is duplicated on the iconbar menu so that you can rename at the record-design stage.
  3936. 0hK    -
  3937. 0((    -
  3938. 0x_    -
  3939. 0 7    -
  3940. -    - 7
  3941. 08g    -
  3942. 00L    -
  3943. These three may be reduced to a single mouse-click if you use the 
  3944. Default database
  3945.  option
  3946.    NAME  
  3947. Fred Bloggs 
  3948. ADDRESS
  3949. 27, Every Street
  3950.      
  3951. Anytown     
  3952.      
  3953. Woolshire
  3954.      
  3955. WL4 7XZ 
  3956. DrawPlus    
  3957. Homerton.Medium
  3958. small_dir
  3959. small_dir
  3960. small_dir
  3961. harddisc
  3962. //////////////////////
  3963. //////////////////////
  3964. ADFS::HardDisc4
  3965.             
  3966. small_dir
  3967. Pictures
  3968. small_dir
  3969. People
  3970. Places
  3971. small_dir
  3972.             
  3973. small_dir
  3974. Animals
  3975. small_c85
  3976. .-,,,-./
  3977. /.-,,,
  3978. /---,
  3979. -..,,
  3980. --,,,
  3981. small_c85
  3982. .-,,,-./
  3983. /.-,,,
  3984. /---,
  3985. -..,,
  3986. --,,,
  3987. small_c85
  3988. .-,,,-./
  3989. /.-,,,
  3990. /---,
  3991. -..,,
  3992. --,,,
  3993. Horse
  3994.             
  3995. small_7f5
  3996. /////
  3997. /////
  3998. ////////
  3999. small_7f5
  4000. /////
  4001. /////
  4002. ////////
  4003. small_7f5
  4004. /////
  4005. /////
  4006. ////////
  4007. !MyPhotos
  4008. !Elements
  4009. !Friends
  4010. small_dir
  4011. Databases
  4012. FredsData
  4013. OtherStuff
  4014. Standard
  4015. It is not usually sensible to build up 
  4016.  derived from 
  4017. Numeric field
  4018. s out of separate bits in this way and, indeed, 
  4019. Powerbase
  4020. t allow you to do so. Numeric 
  4021.  should use one key-field only, the key being the actual 
  4022. numeric value
  4023.  of the field contents.
  4024.  ASCII stands for American Standard Code for Information Interchange.  Each uppercase letter, lowercase letter, numeral, punctuation mark etc. corresponds to a number in the range 32
  4025. 255. (Numbers below 32 are non-printing 
  4026. control
  4027.  characters.) e.g. the numerals 0
  4028. 9 have consecutive ASCII values from 48
  4029. 57, the uppercase letters have consecutive values 65
  4030. 90 and the lowercase letters from 97
  4031. 122. The numbers are used to store the characters within the computer and on disc.  Ordering strings according to their ASCII codes means that those beginning with a numeral will come before those beginning with an uppercase letter and the latter will come before those beginning with a lowercase letter.
  4032. Ch 5 
  4033.  Input Validation and Validation Tables
  4034. Powerbase 
  4035. can apply two kinds of data input 
  4036. validation
  4037. Character 
  4038. validation
  4039. Table 
  4040. validation
  4041. Character 
  4042. validation
  4043. This means exercising control over what characters a field will accept. RISC OS provides the means to allow writable icons to accept only certain characters, or ranges of characters, and reject others. The disallowed characters are simply ignored so that attempts to type them have no effect. 
  4044. If you Shift/double-click on the 
  4045. Powerbase 
  4046. icon the contents of the application directory will be displayed. In it you will see an ordinary directory called 
  4047. Resources 
  4048. and inside 
  4049. Resources 
  4050. you will find a file called 
  4051. ValStrings
  4052. . You are recommended not to alter this file unless you understand exactly what you are doing and to keep a copy of the original. Examining it can, however, give you an insight into the 
  4053. validation
  4054.  process. Look, for example, at the entry beginning 
  4055. 03 Numeric:E:
  4056. . This refers to field type 3 (Numeric) and 
  4057.  tells us that this field type is Editable. The rest of the line is the 
  4058. validation string
  4059.  of the writable icon which makes up a 
  4060. numeric field
  4061. . It looks like this:
  4062. A0-9.+\- ;Pptr_write,4,4
  4063. The initial 
  4064.  is a command which signifies 
  4065. Allow
  4066.  and is the part of the 
  4067. validation string
  4068.  which especially concerns us. It determines what characters the field will allow you to type. In this case they are the numerals 0-9, the decimal point, plus and minus signs and <space>. Why the back-slash before the minus sign? Because 
  4069.  is a special character in an icon 
  4070. validation
  4071.  string (used, as in the 0-9 part of this example, to specify a range of characters) and so are the semicolon, tilde (~) and the backslash itself. To include any of these four characters in the 
  4072. validation
  4073.  string you must precede it with a backslash.  The next character is a semicolon which indicates that a new command follows. 
  4074.  which comes next is the command 
  4075. pointer
  4076. ptr_write
  4077.  is the name of the sprite used to represent the mouse pointer when it is over this type (and many other types) of field. You will have noticed that the usual RISC OS arrow changes to a blue vertical bar, somewhat resembling the caret, when over a writable field. 
  4078.  specifies the 
  4079. active point
  4080.  of the pointer.
  4081. A couple of further examples should be sufficient. 
  4082. 01 Alphanumeric:E:
  4083.  uses the same pointer type but the characters accepted are <space> (immediately after the 
  4084.  for 
  4085. allow
  4086. ), the upper-case letters A-Z, the lower-case letters a-z, the numerals 0-9, some common punctuation and the 
  4087.  character. You might want to add to this list. 
  4088. 06 Calculated:C:
  4089.  uses a different pointer sprite (resembling a pocket calculator) and has no 
  4090. Allow
  4091.  command at all. (You can
  4092. t type into this type of field; its value is calculated from other fields.) The 
  4093.  indicates that this is a Computed field.
  4094. Validation tables
  4095. Table validation is used where a record field is only allowed to have certain 
  4096. values
  4097. . A manufacturing company, for instance, will have a product code for every item it makes and a database of customers which the firm supplies will make use of such codes to identify the items. It is essential that whoever enters data is prevented from typing a spurious code. This can be achieved by linking the appropriate field to a 
  4098. validation table
  4099. . Fields linked in this way are recognizable by having their text dark green instead of black. 
  4100. Powerbase
  4101.  will allow you to type invalid data into the field 
  4102. initially 
  4103. but, when you click the mouse over a new field or type Return, the linked 
  4104. validation table
  4105.  is scanned to see whether what you entered in the field is on the 
  4106. allowed list
  4107. . If it isn
  4108. Powerbase
  4109.  will restore the previous contents of the field and print an error message.
  4110. It is possible to turn off validation by means of an option button on the Preferences window. It may also be toggled on and off with 
  4111. Ctrl F9
  4112. . If validation is turned off the 
  4113. Table 
  4114. button is shaded. 
  4115. Validation table
  4116. s have other uses too. They can have extra columns containing other data about the products, such as a name and a brief description, and lists can be printed in which this more informative data appears instead of the codes.  You can also have 
  4117. Powerbase
  4118.  replace the typed-in code with a longer, more readable, form immediately on entry. Provided the substitute data will fit in the field, replacement occurs when you type Return or click the mouse in another field. If the replacement is too long then the typed-in data will be unchanged.  This can be a great timesaver when a lot of data has to be entered.
  4119. The F.E. college database referred to in 
  4120. 2.2.5
  4121.  makes extensive use of 
  4122. validation table
  4123. s for subjects, courses, tutors and schools of origin. Not only does this trap typing errors but the data entry is greatly speeded up when one can type 
  4124. instead of 
  4125. English Language and Literature
  4126. , yet have the latter printed out on a list by selecting the 
  4127. Expand
  4128.  button in the Print options window.
  4129. Creating a 
  4130. validation table
  4131. Choose 
  4132. Create table
  4133.  from the 
  4134. Validation
  4135. submenu. Give the table a suitable name and enter the number of rows required. This will be the maximum number of items on the 
  4136. allowed list
  4137. . (It is possible to increase the number later if necessary.) Next place the caret in the first row (row 0) of the scrolling list and enter the 
  4138. width 
  4139. (in characters) and the 
  4140. heading 
  4141. (optional) for the first column of the 
  4142. validation table
  4143. If the table is to be used to constrain data entry to an 
  4144. allowed list
  4145.  one column may be all you need. The most common situation, however, is to have two columns, the first holding the 
  4146. allowed list
  4147.  and the second being an expansion or explanation of the former. Use the next row of the scrolling list to enter the column width and heading for the second table column.  It is possible to use very large and complex 
  4148. validation table
  4149. s with all kinds of data associated with each item on the 
  4150. allowed list
  4151. . There is room to specify 20 columns, but even this can be increased if necessary (see 
  4152. You can if you wish choose the foreground and background colours of both the heading and the body of your table by clicking repeatedly with SELECT or ADJUST on the 
  4153. Heading
  4154.  and 
  4155.  icons. Whether this changes the foreground or background colour depends on which of the two radio buttons is selected. 
  4156. When you are satisfied with the data click 
  4157. Create
  4158.  and the table will be created and displayed. It is not saved on disc at this stage.  You may enter data into it now or later. Entries may be freely altered and overwritten. The table will be saved when you close the database or quit 
  4159. Powerbase
  4160.  but, if you want to play safe, click 
  4161. Update
  4162.  on the 
  4163. tool-pane
  4164. Linking tables to fields
  4165. To link your newly-created 
  4166. validation table
  4167.  to a field click MENU over the field and choose 
  4168. Link to table
  4169.  from the 
  4170. Field 
  4171. submenu.
  4172.  This opens the Link window. A pair of bump icons, with the usual pop-up menu alternative, lets you cycle through the tables in memory.  When you have the name of the required table displayed choose the column of the table to which the field is to be linked. It is recommended that column 0 normally provide the link (and therefore contain the data items for the 
  4173. allowed list
  4174. ) and this is set by default. You may, however, link to any column in the table and another pair of bump icons lets you cycle through the column numbers. 
  4175. Select 
  4176. Linked to table
  4177.  and click on 
  4178. . You will see that the foreground colour of the linked field has now  changed from black to green. Place the caret in the field and click on 
  4179. Table
  4180.  on the 
  4181. tool-pane
  4182. . The 
  4183. validation table
  4184.  will be displayed.
  4185. You may link a validation table to a scrollable list.  The link is to a specified column of the list (make sure the pointer is over the required column when you click MENU) and, at present, only 
  4186.  column may be so linked: you can
  4187. t link two different validation tables to two columns of the same scrollable list.
  4188. 5.4.1
  4189. Replace on entry
  4190.  feature
  4191. If you select this button before linking the table a third pair of bump icons becomes active, allowing you to choose which column of the table will replace the data which you type in. In the F.E. college database referred to in 
  4192. 2.2.5 
  4193. the short subject codes (e.g. CHE) would be in the first column and the longer names (e.g. Chemistry) in the second. On typing 
  4194. Return> 
  4195. Powerbase
  4196.  would replace it with Chemistry. In such cases both the entries in the 
  4197. allowed list
  4198.  proper and those in the replacement list are considered equally valid and either may be entered. You could actually type 
  4199. Chemistry
  4200.  if you wished, instead of just 
  4201. , but the former would obviously take longer to enter and you are far more likely to make a mistake, in which case 
  4202. Powerbase
  4203.  would object. 
  4204. 5.4.2
  4205. When to turn off the 
  4206. Exact match
  4207.  button
  4208. Exact match
  4209.  button is normally selected to indicate that the only user inputs which will be accepted are those which exactly match an entry on the 
  4210. allowed list
  4211. .  Deselecting the button allows you to type inputs which are 
  4212. longer
  4213. but not 
  4214. shorter
  4215. than the entries on the 
  4216. allowed list
  4217.  so long as the
  4218.  leftmost part
  4219.  of the input matches such an entry. This feature is intended for use with the 
  4220. Replace on entry
  4221.  facility. The unmatched 
  4222.  of your typed entry will be attached to the end of the replacement string.  Suppose your database records numbers of items called Widgets, Doodahs and Thingummies. You decide to identify these names with the codes W, D and T you would normally put the codes in the first column of the table and the names in the second and select 
  4223. Replace on entry
  4224. . You can then type 
  4225. <Return> and it will be replaced with Widgets. What you might want, however, is to type 
  4226.  and have it replaced with Widgets, 7.  Deselecting 
  4227. Exact match
  4228.  allows you to do just that since the W in W7 matches an entry in the validation list. The 
  4229. expanded
  4230.  entry in the second column is made to read 
  4231. Widgets, 
  4232.  (note the comma and space) and 
  4233. Powerbase 
  4234. tacks the unmatched part of the entry onto the end of this so that 
  4235.  is replaced with Widgets, 7.
  4236. 5.4.3
  4237. Conditional validation
  4238. There are times when the validity of a data item in one field might depend on the contents of another field. In other words, entering a value in the first field which matches an item in the allowed list of the table isn
  4239. t good enough; there must be a specific value in the second field as well. This sounds a bit complicated and a hypothetical example might make it clearer.
  4240. For the purpose of providing suitable ancillary courses, A-level students in a Further Education College are categorised according to whether they take all Science/Maths A-levels (code=S), all Arts/Humanities (code=A) or a mixture of both (code=M). These single-letter codes are entered in a field with the tag TYPE and the ancillary courses are entered in a field called ANCL. 
  4241. Some of the ancillary courses are suitable for anybody, others are specific for science or arts students and yet others are especially aimed at the mixed-discipline students. These courses are listed in a validation table which has three columns. Column 0 contains a 3-letter code for rapid entry of the course in ANCL and column 1 contains the full title of the course for printing on class lists, timetables etc.
  4242. The final column (2) indicates which type of student the course is suitable for. More than one type may be entered by separating the codes with commas. Thus, a course on the history of science might be aimed at science students and mixed discipline students and would have S,M in column 2. A course suitable for everybody would have A,S,M in column 2.
  4243. In the Link window we link ANCL to column 0 of the table, thus ensuring that only courses which are actually in the table are acceptable. We also select the option button to the left of the writable icon, enter TYPE in the writable icon, and click the associated bump icons until the matching column is 2. What we are saying here is that merely entering any old course from column 0 won
  4244. t necessarily result in a valid entry; whether it does or not is 
  4245. conditional
  4246.  upon the contents of TYPE. Thus, if we try to enrol a type H student for a course which is only suitable for type S students the entry will be rejected with an explanatory message, even though the course code is valid insofar as it is present in column 0.
  4247. Displaying 
  4248. validation table
  4249. Placing the mouse pointer over a linked record field and double-clicking with SELECT makes a small window pop up to the right of the field.  This shows all the data which is on the same row of the 
  4250. validation table
  4251.  as the linked item. The item from the 
  4252. allowed list
  4253.  is highlighted in green and the item (if any) to be substituted on entry is shown in red.  This feature is very useful if you are examining a database which uses coded data and you encounter an unfamiliar code.  
  4254. You can also make this window appear automatically whenever the caret enters a linked field. To turn  the feature on choose 
  4255. Preferences
  4256.  from the iconbar menu and select the 
  4257. Display linked table data
  4258.  button.
  4259. When linked to a field in the database record the complete table may be displayed by placing the caret in the linked field and clicking 
  4260. Table 
  4261. button (
  4262. ) on the tool-pane. Alternatively, any table present in memory, whether linked to a data field or not, may be displayed by selecting it from the 
  4263. Display table
  4264.  submenu (reached from the 
  4265. Validation
  4266. submenu). 
  4267. validation table
  4268.  menu
  4269. Clicking MENU over a displayed table offers a menu with entries as follows:
  4270. Clear 
  4271. removes all data from the table, leaving it blank. Since wiping out a table in this way is pretty drastic you will be asked to confirm the operation before it actually takes place. It is possible to recover the table using 
  4272.  all 
  4273. provided the table has not been closed. When you close a database all the 
  4274. validation table
  4275. s in memory are written to the disc so you will over-write your disc copy with the blank table.
  4276. Modify
  4277. brings up the same window as you used to create the table. You may then increase the number of rows, add extra columns, alter the order of existing columns or, indeed, do anything sensible. Be careful about renaming columns; combining this with shuffling the columns about is apt to cause confusion: 
  4278. Powerbase
  4279. t a mind-reader! When you have made the required changes click on  
  4280. Modify
  4281. Print 
  4282. outputs the contents of a 
  4283. validation table
  4284.  in the same format as a report. The output appears in a window from which it may be saved as a text file (see 
  4285. 3.1.1
  4286.  <column> 
  4287. will sort the table on whichever column the mouse pointer was over when you clicked MENU on the table.
  4288.  change 
  4289. will restore the specific item which you were pointing at when you clicked MENU to the state it was in when the table was displayed. You 
  4290. cannot
  4291.  changes if you have closed the table then re-displayed it.
  4292.  all 
  4293. restores the entire table to the state it was in when first displayed, even if 
  4294. Clear
  4295.  has been used. You 
  4296. cannot
  4297.  changes if you have closed the table then re-displayed it.
  4298. leads to a 
  4299. Save box
  4300.  in which the default pathname points to a directory called 
  4301. ValTables
  4302. inside the database application directory. Since that
  4303. s where 
  4304. Powerbase
  4305.  expects to find the tables for a database you should normally accept this pathname by clicking on 
  4306.  or typing Return. Only if you are transferring tables from one database to another should you need to drag the icon to a filer window. 
  4307. validation table
  4308. s in memory are, in any case, saved to the 
  4309. ValTables
  4310. directory of the database when you close the database or quit 
  4311. Powerbase
  4312.  and you can also make this happen at any time by clicking 
  4313. Update
  4314. on the 
  4315. tool-pane
  4316. Save as CSV 
  4317. leads to a 
  4318. Save box
  4319.  from which the table contents can be saved as a 
  4320. CSV file
  4321. . The default pathname points to the database
  4322. PrintJobs
  4323.  directory.  The file can be loaded into a blank validation table of appropriate format by dropping the file onto the open table (see 
  4324.  for further details).
  4325. Loading validation tables
  4326. A table linked to a field is automatically loaded when the database is opened. If not yet linked, however, the table won
  4327. t be in memory unless you have just created it.  
  4328. Show files
  4329.  on the 
  4330. Validation
  4331. submenu (
  4332. Ctrl Q
  4333. ) will display the 
  4334. ValTables
  4335. directory and the required tables can dragged onto the 
  4336. record window
  4337.  (or simply double-clicked). Even more conveniently, 
  4338. Show 
  4339.  is provided with its own submenu listing the 
  4340. les in 
  4341. ValTables,
  4342.  and tables may be loaded by choosing them from this submenu. 
  4343. Each table is displayed as it loads.
  4344. There may be times when you wishes to use a 
  4345. validation table
  4346.  to hold some data, but don
  4347. t want to use it to validate input into a field or to link it to a field at all. It is possible to load a 
  4348. validation table
  4349.  once the database is open by using the procedure described in the previous paragraph, but a more convenient solution is to add a 
  4350.  character to the end of the table
  4351. s name (the usual limit of 10 characters applies to the name length).  
  4352. Powerbase
  4353.  will then load it whether any field is linked to it or not 
  4354. Including 
  4355. validation table data in printouts
  4356. Validation table
  4357. s are often used to allow short codes to be entered in records but with a link to a more descriptive entry in another column of the table.  If this is all that is required then always put the data which makes up the actual 
  4358. allowed list
  4359. , i.e. the items which are allowed in the fields of the main record, into the first column of the table (column 0) and set the link from the record field to this column. The more detailed 
  4360. expanded
  4361.  entry should go in column 1. Printing with the 
  4362. Expand
  4363. button in the 
  4364. Print options
  4365.  window selected  will then print the column 1 
  4366. instead 
  4367. of the column 0 entry. 
  4368. You can also include data from other columns of a table by displaying the table  and clicking in the required columns with ADJUST, exactly like selecting main record fields for printing (see 
  4369. ). It is immaterial which row you click on; only the column matters and the highlighting to show which columns are selected always appears in the first row. The columns selected in all tables are saved as part of a print Selection file and may therefore be retrieved for future use. As well as highlighting the required columns you will also need to select the 
  4370. Expand
  4371. button as described above. Printed reports will then include all the data from the highlighted columns. You will need to use this method if you want to print columns 0 
  4372. 1 of a table instead of printing column 1 
  4373. instead
  4374.  of column 0 as described in the previous paragraph.
  4375. Entering validation table data into a record
  4376. If you place the caret in a database field and then double-click over an entry in an open validation table, the table entry will be copied into the data field, if it will fit. Nothing is copied if the item is too long to fit. This also works for entering validation table data into writable icons in dialogue boxes and into Scrollable lists.
  4377. In this last case the caret moves to the next cell of the list after the string has been inserted, thus making it very easy to insert several items in quick succession. If, on reaching the last cell in the last row, you hold down Shift while double-clicking in the validation table, a new row is inserted in the Scrollable list.
  4378. n as de
  4379. 0(e    -
  4380. 0p]    -
  4381. 0L8    -
  4382. * If you have closed the database  the table won
  4383. t have been reloaded on opening again. See 
  4384.  for how to load your table for linking.
  4385. * This feature cannot be used on tables created with early versions of 
  4386. Powerbase
  4387.  and the option will be shaded in such cases. The commonest reason for needing to modify such a table is to increase the number of rows. First export the data as a CSV file then create a new table with the required number of rows and drop the CSV file onto it (see 
  4388. Ch 6 
  4389.  Performing Calculations
  4390. There are four mechanisms for performing 
  4391. calculations
  4392. Powerbase
  4393. Computed fields 
  4394. (see 
  4395. 4.2.11
  4396. . These are self-calculating and may be time and date-dependent without depending on the values of other fields, or they may derive their values from other fields in the record and auto-update when one of those fields is altered.
  4397. Calculations which are derived from one or more data fields but are not stored in fields themselves. They exist only for inclusion in reports and results are calculated 
  4398. on the fly
  4399.  during report generation.
  4400. Calculations which are derived from one or more data fields and entered into another field by means of an 
  4401. Evaluate
  4402.  button (see 
  4403. 4.2.13
  4404. Arithmetic performed on a column in a report. 
  4405. Computed fields
  4406.  may be of Calculated or Composite types. 
  4407. Calculated field
  4408. s display a numeric result and Composite fields display a character string. They are readily recognised by moving the mouse pointer over them: on Calculated fields the pointer shape changes to resemble a pocket calculator; on Composite fields it changes to a large blue 
  4409. . The latter do not, strictly, involve 
  4410. calculations
  4411.  at all but because Composite and 
  4412. Calculated field
  4413. s work in the same way it is convenient to deal with them together. It isn
  4414. t possible to type data directly into either of these special types of field.
  4415. Many of the Stamp fields listed at the beginning of section 
  4416. 4.2.12 
  4417. have exact counterparts among the Computed fields. The relevant type are (c), (d), (e), (f), (g) and (h), all of which are concerned with time and date. They have identical names to their Stamp equivalents but, whereas Stamp fields are entered when the record is created and don
  4418. t (apart from Last altered) change thereafter, the Computed types update whenever a record is displayed
  4419. It is also possible to write your own functions in Basic and use them in Calculated and 
  4420. Composite field
  4421. s. The system variable TIME$ is useful in this connection. 
  4422. Calculated field
  4423. 6.1.1
  4424. Simple calculations using 
  4425. Numeric field
  4426. Our first example will be to make a field containing a v.a.t. 
  4427. exclusive 
  4428. price determine the contents of another field which includes v.a.t. at 17%.  Let the 
  4429.  of these fields be VEX and VINC respectively. Click MENU over VINC to bring up the 
  4430. Field 
  4431. submenu and choose  
  4432. Calculations
  4433. .  A window appears with a writable icon which contains: 
  4434. VINC=
  4435. Complete the formula so that it reads:
  4436. VINC=VEX*1.17
  4437. and click on 
  4438. or type Return. From now on the value in VINC will change whenever you type something in VEX.  Since the v.a.t. rate is liable to change it would be better to place the current percentage rate in another 
  4439. Numeric field
  4440.  called RATE and make the formula attached to VINC read:
  4441. VINC=VEX+(VEX*RATE/100)
  4442. The second example calculates the average of four fields whose tags are No1, No2, No3 and No4, placing the result in a 
  4443. Calculated field
  4444.  called AVGE.  The required formula is:
  4445. AVGE=
  4446. (No1+No2+No3+No4)/4
  4447. If you decide to actually try these examples be sure to make the Calculated field either an integer or fixed-point type, otherwise strings of unwanted decimal places are likely to occur!
  4448. You may also enter a tag into a calculation formula by clicking on the required field with Ctrl held down or by choosing it from the pop-up menu of fields available from the calculation window. The tag will be entered in the formula at the caret position. You are strongly recommended to use one or other of these methods since 
  4449. Powerbase
  4450.  finds it very difficult to decide whether or not a formula is valid and errors are usually detected only when the calculation is actually attempted.
  4451. 6.1.2
  4452. Making 
  4453. calculations retrospective
  4454. The default setting is such that entering or altering a formula affects only those records added or altered after the formula entry/change. The changes can be made retrospective by selecting the 
  4455. Recalculate existing records
  4456.  button on the formula entry window. On clicking 
  4457. you will be asked to confirm that you want previous records to be made consistent with the formula you have just entered. Changes affect the current subfile only, but can be easily implemented in other 
  4458. subfiles
  4459.  by changing to the required subfile, calling up the formula entry window, selecting the option button and clicking 
  4460. The Preferences window, accessible from the iconbar menu, contains a button labelled 
  4461. Recalculate on opening
  4462. . If this is selected then calculations involving the system variable TIME$ will be updated automatically for all records when the database is opened (see also 
  4463. 6.1.3
  4464. Calculations using 
  4465. numeric
  4466.  field
  4467. s (!)
  4468. This isn
  4469. t as daft as it looks! You might think that the process described in 
  4470. 6.1.1 
  4471. is only applicable to 
  4472. numeric field
  4473. s, but a non-
  4474. numeric field
  4475.  may be specified in the formula 
  4476. it is linked to a 
  4477. validation table
  4478. . To be of use there must be  numeric data in the column of the 
  4479. validation table
  4480. immediately following
  4481.  the one to which the field is linked (see 
  4482. ). Suppose, for example, we have fields in a student record for A-level exam grades, the field 
  4483.  being GR1, GR2, GR3, GR4. The grades are non-numeric but they map onto the numeric points system which universities use to control entry. The relationship of grades to points is as shown at left. A 
  4484. validation table
  4485.  could be set up with the grades in column 0 and the equivalent points in column 1. Each of fields GR1
  4486. GR4 would be linked to column 0 thus restricting input to the capital letters A-E. A further field of Calculated type would be created to hold the points score. If we associate this field (PTS) with the formula:
  4487. PTS=GR1+GR2+GR3+GR4 
  4488. entering or changing the letter grades in GR1-GR4 will make the correct score appear in PTS.
  4489. 6.1.4
  4490. Calculations involving times
  4491. There is an Editable field type called Time which will only accept valid 24-hour times in hh:mm:ss format.  If the tag of such a field is included in a calculation formula it will be converted into seconds and the result used in the calculation. Thus a 
  4492. Calculated field
  4493.  DIFF could use two 
  4494. Time field
  4495. s, TIM1 and TIM2, in the formula:
  4496. DIFF=TIM1-TIM2
  4497. Powerbase
  4498.  would keep DIFF updated to show the difference in seconds between the two times.  Three times could be averaged and the result (in seconds) placed in a field AVGE using the formula:
  4499. AVGE=(TIM1+TIM2+TIM3)DIV 3
  4500. (The use of DIV here, rather than /, ensures that the result is an integer.)
  4501. 6.1.5
  4502. Calculations involving dates
  4503. You may also include date fields in a calculation in a similar manner to the use of Time fields (see 
  4504. 6.1.4
  4505. ). A Calculated field DIFF could be used to show the number of days between two dates using the formula:
  4506. DIFF=DAT1-DAT2
  4507. Composite field
  4508. To enter the formula for a 
  4509. Composite field
  4510.  follow the same procedure as for a 
  4511. Calculated field
  4512. . Note that the relevant entry on the 
  4513. Field
  4514.  submenu now says 
  4515. Combine fields
  4516. . Formula entry is similar to that for 
  4517. Calculated field
  4518. s. The result of the 
  4519. calculation
  4520.  is a character string and is usually result of string operations. One of the most frequently used will be 
  4521.  which allows fields to be joined together.  Suppose your database contains fields for surname (SNAM) and forename (FNAM) and you want to be able to print names in the format forename-surname. Define a 
  4522. Composite field
  4523.  called NAME and attach to it the formula:
  4524. NAME=FNAM+
  4525. +SNAM
  4526. Note the quoted space separating the names.  You might want the NAME field to show only an initial plus the surname. This could be extracted using the Basic function LEFT$ * to produce the formula:
  4527. NAME=LEFT$(FNAM,1)+
  4528. +SNAM
  4529. Composite field
  4530. s may be used in conjunction with 
  4531. Time field
  4532. s to perform genuine 
  4533. clock arithmetic
  4534. , e.g. referring to the examples in 
  4535. 6.1.4
  4536. , if we attached the formulae to 
  4537. Composite fields
  4538.  instead of Calculated fields they would display the difference and average respectively in hh:mm:ss format instead of in seconds. 
  4539. As with 
  4540. Calculated field
  4541. s updating occurs after editing a field whose tag appears in the attached formula. Thus NAME would be updated after changes to FNAM or SNAM and DIFF after changes to TIM1 or TIM2. You can, however, have 
  4542. Composite field
  4543. s which make use of the Basic system variable TIME$. Thus a field DAY could be linked to the formula:
  4544. DAY=LEFT$(TIME$,3)
  4545. to make it show today as Mon, Tue etc. No field 
  4546.  are referred to in the formula so DAY gets updated immediately before displaying the record so that the information is correct at that time. (Note, however that there is a dedicated Composite type for displaying the short-form day of week. See beginning of chapter.)
  4547. User functions
  4548. These are functions, written in Basic, which accept field 
  4549.  as parameters and can be included in the 
  4550. calculation formulae
  4551. self-calculating
  4552.  fields. All such functions must return only their principal value: RETURN variables in the parameter list aren
  4553. t allowed. The name of each function must begin with an upper-case 
  4554. , e.g. FNUaverage. This avoids duplication of function-names which occur in 
  4555. Powerbase
  4556. Each user function to be used by a database should be in the form of a separate Basic file. The files may be called whatever you like, but it is sensible to use names closely related to the actual function names. All the Basic files are stored in a subdirectory of the database called 
  4557. UserFuncs
  4558. . An entry on the 
  4559. Miscellaneous 
  4560. submenu (keystroke equivalent 
  4561. Ctrl Y
  4562. can be used to display the 
  4563. UserFuncs
  4564.  directory and, unless the directory is empty, this menu entry will have its own submenu listing the contents by 
  4565. lename. Choosing an item from this submenu loads the relevant Basic 
  4566. le for editing.
  4567. When the database is opened each function is loaded using Basic
  4568. s LIBRARY command. 
  4569. Powerbase
  4570.  can then call the user functions just as readily as its own functions. When a user function appears in a calculation formula the tags of any fields on which the function operates are included as parameters to the function. Editing any such field makes the 
  4571. Computed field
  4572.  update.
  4573. A menu of user functions is available from the Formula window to make them more easily accessible. This is quite different from the menu of 
  4574. lenames referred to above in that it lists the actual 
  4575. function 
  4576. names as given in the Basic DEF FN statement. 
  4577. To enable you to see the number and type of parameters required by the functions these parameters appear in the menu as Basic variable names. When actually using a function in a formula the variable names should be replaced with field tags.
  4578. The distribution disc includes a 
  4579. UserFuncs
  4580.  directory containing examples of useful user functions, two of which were kindly submitted by David Lenthall. Users are invited to submit other user functions for possible inclusion in the function library. FNUnow operates on the value of TIME$ from the real-time clock and returns a string containing the current date in form DD-MM-YY. A record design could include a field of Composite type, at least eight characters long and tagged as, for example, DATE. Associating the field with the following formula would cause the field to display the current date at all times:
  4581. DATE=FNUnow(TIME$) 
  4582. If the function always operates on TIME$ and never on any other string, why do we bother including TIME$ as a parameter to the function?  A Calculated or Composite field is normally only updated when you edit a field on which its value depends.  The field DATE in the above example doesn
  4583. t depend on any other fields and would therefore never be updated!  The inclusion of TIME$ causes the Composite field to be updated immediately before the record is displayed.  The same trick of using TIME$ as a parameter, even if the function makes no use of it at all, can be used for any user function associated with a field which you want updating without having to edit the record, but note that updating will only occur if you call up the record for display. See 
  4584. 14.4.3
  4585.  for how to make 
  4586. records in the current subfile update on opening the database.
  4587. The second function, FNUageinyrs accepts two parameters, each of which should a date in DD-MM-YY format, and returns the difference between the dates to the nearest year. The first date should be the earlier of the two. If your record design has a field for Date of Birth (let
  4588. s call its tag DOB) you can use this function together with FNUnow (which returns today
  4589. s date in the required format) to make a 
  4590. Composite field
  4591.  (AGE) display a person
  4592. s age in years by using the formula: 
  4593. AGE=FNUageinyrs(DOB,FNUnow(TIME$))
  4594. Considerable care is needed in constructing user functions as it is very easy to make 
  4595. Powerbase
  4596.  generate errors. In particular you must avoid giving a function a name which is the same as a field tag 
  4597.  or even one which contains a field tag as a substring. The two functions described could not, for instance, be used in a database which had a field tagged as 
  4598. , although 
  4599.  and 
  4600.  could be used.  To avoid this problem users are recommended to form the habit of giving tags names in upper case and user functions names in lower case (apart from the 
  4601. , of course).
  4602. Calculations for reports only
  4603. Computed fields based on other fields have the disadvantage of requiring the user either to foresee at the time the database is designed what calculations will be required or reformat it later in order to include a field which might only be needed for a one-off inclusion in a report. To avoid this, 
  4604. Powerbase
  4605.  lets you specify such calculations 
  4606. without
  4607.  the need for a field to which to attach them. In a sense they resemble the column calculations described in section 
  4608.  in that they are performed on the fly during the creation of a report.
  4609. To define a calculation choose the entry 
  4610. Extra calculations
  4611. Ctrl Shift N
  4612. ) from the 
  4613. Print
  4614.  submenu. The window which appears requires you to enter a formula, which has exactly the same format as the formulae attached to Calculated and Composite fields (see 
  4615.  and 
  4616. ). Since the calculation will not be attached to a field from which to derive a heading, a width, and whether the result is to be numeric or not, you must supply this data yourself.  If you omit anything 
  4617. Powerbase
  4618.  will use the formula itself as a heading, assume a Numeric result and assign a width of 15 characters (the maximum space a number can occupy). If you have clicked the radio button to select a String (i.e. non-numeric) result such as would be placed in a Composite field, the width will default to 255 characters. This might seem an enormous value, but unnecessary 
  4619. white space
  4620.  will be removed from the report before printing if the output is to the printer. If the report is to be displayed in a window the 
  4621. Shrink list 
  4622. button on the Print options window should be selected. Failing this you may remove the surplus space by choosing 
  4623. Shrink list
  4624.  from the menu over the report window.
  4625. It is possible to produce errors by unsuitable combinations of fields and result types (just as it is for Computed fields). The main thing to remember is that Numeric fields will normally produce a numeric result so assigning a String operation to such fields can be expected to produce an error. There are exceptions even to this rule since the Basic STR$() function may be used to convert a number to a string, thus allowing Numeric fields to give a String result. Dates, Times and User Functions may be used in Extra calculations, just as they can in Computed fields.
  4626. When you have defined your calculation, click on 
  4627. Include
  4628. . The displayed calculation number will go from 0 to 1 and the window is set up for entry of another calculation. A total of 10 (numbered 0-9) are allowed and you may return to earlier calculations to edit them by clicking the 
  4629.  icons.
  4630. The position of such calculated results in the report is determined by the point at which you define them. If you click ADJUST to highlight a field, then type 
  4631. Ctrl Shift N
  4632.  to bring up the new window and define a calculation, and finally highlight another field, the calculated result will appear between the highlighted fields. The menu of selected fields (see 
  4633. 3.7.2, S
  4634. ) shows these calculations in red so you can easily check on the order in which things will appear on the report. You can choose the red entries from this menu to bring up the calculation window for editing. 
  4635. All defined calculations are saved as part of a Print Selection and will be restored when the Selection file is subsequently reloaded. The 
  4636. Clear
  4637.  button on the calculation window has the same effect as 
  4638. Clear selection
  4639. Ctrl Z
  4640. ) from the 
  4641. Print
  4642.  submenu.
  4643. Calculations from an Evaluate button
  4644. The Evaluate button was briefly mentioned along with the Increment button (see 
  4645. 4.2.13
  4646. ). It enters the result of its computation into a data field having the 
  4647. same tag
  4648.  as the button. The formula associated with the button is of exactly the same type as for a Calculated or Composite field and is entered by choosing 
  4649. Formula
  4650.  from the 
  4651. Field
  4652.  submenu obtained by clicking MENU over the button.
  4653. Unlike a Calculated or Composite field the data field does not auto-update when one of the fields referred to in the formula is edited: you have to click the Evaluate button to update the field. This method of performing calculations does, however, have two important advantages: the Evaluate button can be added to an existing database without reformatting and the field which receives the result of the computation can be of any Editable type.
  4654. Calculations on a column
  4655.  of a report
  4656. There is an option on the 
  4657. Print 
  4658. submenu called 
  4659. Numeric field
  4660.  which is normally shaded. It only becomes available when you highlight one or more 
  4661. field
  4662. s of numeric type for printing. These may be editable Numeric 
  4663. elds, Calculated 
  4664. elds or any 
  4665. elds of the Computed or Stamp class which are essentially numeric. You can then access a window listing all the fields (if any) in the record which are of these two types. Associated with each field are six 
  4666. check-box
  4667. es which can be selected to  include the following in the report: 
  4668. Count (number of values in column)
  4669. Average
  4670. Standard deviation
  4671. Maximum value in column
  4672. Minimum value in column  
  4673.           
  4674. check-box
  4675. es are shaded until a field is included in a print selection. They then become 
  4676.  and any or all of them may be chosen by clicking with SELECT. The information requested is then added to the report 
  4677. footer
  4678.  when printing takes place.
  4679. To obviate the need to select a lot of check-boxes individually when many numeric 
  4680. elds are highlighted, option buttons are provided which enable all the enabled check-boxes in a column to be selected or deselected with a single mouse click.
  4681. Another entry on the 
  4682. Print
  4683.  submenu provides a similar facility for 
  4684. Check-box
  4685. . Instead if six check-boxes for each qualifying field there is just one which, as before, is shaded unless the field is included in a print selection.
  4686. For 2-state check-boxes the information printed at the foot of the report consists of  the numbers selected and unselected. For 3-state boxes the number in each of the three states is printed. The results are labelled 
  4687.  and 
  4688. Neither
  4689. , except in the case of the F/M/<blank> box where the labelling is 
  4690. Female
  4691. As in the case of numeric 
  4692. elds, an option button allows all the enabled check-boxes in the window to be selected or deseleted.
  4693. eport 
  4694. 0X=    -
  4695. 0`{    -
  4696. * LEFT$(string$,n) extracts the leftmost n characters from string$.  RIGHT$(string$,n) extracts the rightmost n characters.  MID$(string$,n,m) extracts m characters starting at the n
  4697. th character from the left.
  4698. Grade  
  4699.  Points 
  4700. 10   
  4701.  8    
  4702.  6    
  4703.  4     
  4704. Ch 7 
  4705.  Using extra indexes 
  4706. The record data is stored in a file called 
  4707. Database 
  4708. inside the database
  4709. s application directory. The order of records within the 
  4710. Database 
  4711.  is determined by the order in which the records are entered. To access the records in a logical order we need one or more 
  4712. indexes
  4713. Powerbase
  4714.  does have 
  4715. sorting 
  4716. facilities for sorting reports and  
  4717. validation table
  4718. s, but data ordering is achieved mainly by the use of 
  4719. indexes
  4720. The most important 
  4721. index
  4722. index
  4723.  0. This is always called 
  4724. PrimaryKey
  4725.  and is created as part of the process of setting up a database (see 
  4726. ). You will find the file 
  4727. PrimaryKey
  4728. inside the database directory. Other, 
  4729. subsidiary
  4730. indexes
  4731.  are stored in the database
  4732. Indexes 
  4733. directory
  4734.  and all have a large
  4735.  on their icon. When a database is opened any 
  4736. indexes
  4737.  in this directory will be loaded automatically. (
  4738. Indexes
  4739.  operate in memory 
  4740.  to achieve maximum speed 
  4741.  not from disc.) Changes to the database update the 
  4742. indexes
  4743.  and closing the database (or quitting 
  4744. Powerbase
  4745.  itself) causes the updated 
  4746. indexes
  4747.  to be written back to the disc. 
  4748. Note that the more 
  4749. indexes
  4750.  you use the longer it takes to add and delete records or to make alterations to records which involve changing 
  4751. indexes
  4752. . The ideal situation might seem to be to have 
  4753. fields 
  4754. index
  4755. ed and, given a fast enough machine and a record structure with not very many fields, this might be feasible. Remember that fields which are repetitive (those which have only a few distinct values repeated throughout many records) do not 
  4756. index
  4757.  efficiently.
  4758. Subsidiary indexes can speed up report printing in some cases (see 
  4759. ).  When you enter a query 
  4760. Powerbase
  4761.  will see if a subsidiary index can be used with advantage and, if so, will go ahead and use it.  To indicate that this is happening the number of the subsidiary index will appear in the icon at the  top right of the query panel (also used to indicate when records are marked). For the speed-up to work the case button on the query panel must match the case-dependence of the index. This is a point easily overlooked!
  4762. Indexing a field
  4763. Click MENU over the required field and choose 
  4764. Create
  4765. Index
  4766.  (Ctrl J
  4767. ) from the 
  4768. Field 
  4769. submenu. The 
  4770. Key structure
  4771.  window will appear with the tag of the field you clicked on in the first of the four 
  4772. Field
  4773.  icons. You may use the bump icons or pop-up menus to bring the 
  4774.  of the other fields into view if you wish to base the 
  4775. index
  4776.  on more than one field. Enter the data in exactly the same way as when creating the 
  4777. primary key
  4778. index
  4779.  (see 
  4780. ) and click on 
  4781. Create
  4782. . If the field is already 
  4783. index
  4784. ed you will be warned of this and asked if you wish to overwrite the existing 
  4785. index
  4786. . When 
  4787. index
  4788. ing is complete you will see that the 
  4789. descriptor
  4790.  of the 
  4791. index
  4792. ed field has changed from black to dark blue. 
  4793. If you click the 
  4794.  button on the 
  4795. tool-pane
  4796. Shift F4/F5
  4797. ) the red highlighting of the descriptor which indicates the current key moves from one 
  4798. index
  4799. ed field to another. When you have a 
  4800. subsidiary key
  4801.  selected as the current key it works just like the 
  4802. primary key
  4803.  as regards browsing, 
  4804. searching
  4805.  and printing. 
  4806. There is nothing to stop you 
  4807. index
  4808. ing one field whilst a subsidiary 
  4809. index
  4810.  based on another field is the currently-active one, thus producing what amounts to a sort within a sort.
  4811. One button which was shaded when creating the primary key is the option button 
  4812. Omit null keys
  4813. . Although null primary keys aren
  4814. t allowed null subsidiary keys are and the default setting for this button is therefore OFF.  The field being indexed might in some cases be null most of the time and you want to index only the records in which it isn
  4815. t null.  If so, select the button before clicking 
  4816. Create.  
  4817. Index
  4818.  entry on the main menu leads to a submenu offering four choices.  
  4819. Show details
  4820. Ctrl K
  4821. ) displays the structure of the currently active key.  
  4822. Show files
  4823. Ctrl I
  4824. ) opens the 
  4825. Indexes
  4826.  directory and, unless the directory is empty, has its own submenu listing the names of the 
  4827. les. Choosing from this menu makes the chosen index the currently-active one. 
  4828. Delete
  4829.  allows you to remove an index (after confirmation).  The index file is moved from 
  4830. Indexes
  4831.  into a subdirectory called 
  4832. Deleted
  4833. .  Such an index is no longer active and will not be loaded when the database is opened. You can, however, restore it by moving  it back into 
  4834. Indexes
  4835.  but it is only useful to do so if no records have been added to or removed from the database in the meantime. 
  4836. Rebuild
  4837.  displays the structure of the current index and allows you to rebuild it, with or without modi
  4838. cation.
  4839. Automatic saving of 
  4840. indexes
  4841. Indexes
  4842.  are written to disc when you close a database or quit 
  4843. Powerbase
  4844.  but, as long as the database remains open, they are in memory and therefore could be lost if the power fails or the computer is switched off.  Occasional use of the tool-pane
  4845. Update
  4846.  button
  4847.  ensures that the disc copy of all 
  4848. indexes
  4849.  is more or less up-to-date but you can automate the process if you wish. Choose 
  4850. Preferences
  4851.  from the iconbar menu, make the appropriate selection from the 
  4852. Save 
  4853. indexes
  4854.  section of the 
  4855. Preferences
  4856.  window and click on 
  4857. Accept
  4858. . You may make 
  4859. Powerbase 
  4860. save the 
  4861. indexes
  4862.  at regular intervals or simply warn you to do so.
  4863. 0xL    -
  4864. Ch 8 
  4865.  Exporting and Importing data - CSV files
  4866. What are 
  4867. CSV files
  4868. CSV stands for 
  4869. comma-separated values
  4870.  and is the name given to files consisting of lines of data, each of which contains individual data items separated from each other by commas. Such files are widely used to mail-merge using a wordprocessor (see 
  4871. ) and also to transfer data from one application to another, e.g. from a database to a spreadsheet or from a RISC OS database to a PC database. We will refer to each line in a CSV file as a 
  4872. record
  4873.  and each item of data in such a line as a 
  4874. field 
  4875. since records and fields are the source and destination of such data when it is exported from or imported into a 
  4876. Powerbase 
  4877. database. 
  4878. The following points should be noted:
  4879. Fields which are non-numeric (e.g. plain text items such as names and addresses) are often enclosed in double quotes (
  4880. ) whereas numeric data is not. This makes it possible for an application reading a CSV file to distinguish between numbers and strings (which might of course contain numerals) and also allows a comma to be used as a character within a string without being mistaken for a data separator. (Addresses often contain commas e.g. 112, Keighley Road).  For many purposes the quotes aren
  4881. t necessary and may be omitted.
  4882. Null fields are usually included and can be located by looking for two commas with either nothing in between them or with only two double 
  4883. quotation marks
  4884.  between them, i.e. ,, or ,
  4885. ,. Each record in such a file will always contain the same number of fields. 
  4886. Powerbase
  4887.  does, however, allow nulls to be omitted entirely when creating a file in which case the number of fields per record will vary.
  4888. The way in which each record is terminated varies from one system to another. The last field in a record is followed not by a comma but by a 
  4889. line terminator
  4890. . On RISC OS systems this is the same as in ordinary text files; the 
  4891. linefeed 
  4892. character (LF, ASCII value 10) and on PCs it is usually the 
  4893. carriage-return
  4894.  character (CR, ASCII value 13). You might, however, encounter 
  4895. CSV files
  4896.  in which 
  4897. both 
  4898. these characters are used, i.e. LF CR or CR LF.  You can define any character or character-pair as the record 
  4899. terminator
  4900. Separators 
  4901. other than commas are sometimes used. The Tab character (ASCII value 9) is often used and such files are called 
  4902. tab-separated values
  4903. files
  4904. Powerbase
  4905.  lets you define any character, or even a pair of characters, as the field separator. All such files created by 
  4906. Powerbase
  4907.  will be of type &dfe and display the CSV file icon (although the default filenames offered do differ: 
  4908. CSVfile
  4909.  where the separator really is a comma, 
  4910. TSVfile
  4911.  where it
  4912. s a TAB and 
  4913. ?SVfile
  4914.  otherwise). 
  4915. In what follows we will, for convenience, refer to them all as 
  4916. CSV files
  4917.  whether or not the separator is a comma.
  4918. Some applications which accept a CSV file as input expect the first line to contain the names of the fields which comprise the subsequent records, e.g. if each record consists of a name and a four-part address this 
  4919. header record
  4920.  might read:
  4921. STREET
  4922. COUNTY
  4923. POSTCODE
  4924. Powerbase
  4925.  can both export and import files with such a header.
  4926. Setting the 
  4927. CSV options
  4928. Choosing 
  4929. Export 
  4930. CSV file => 
  4931. Options
  4932.  from the main menu displays the CSV options window which lets you specify all the file characteristics described earlier.  Pop-up menus give you a choice of 
  4933. field-separators
  4934.  and 
  4935. record-terminators
  4936.  with space to enter your own if you wish.  The first three option buttons cause an exported file to have, respectively, the following characteristics when the button is selected:
  4937. quotes round non-numeric fields 
  4938.  see (1) above
  4939. a header record specifying the field names as either tags or descriptors 
  4940.  see (5) above
  4941. null fields included 
  4942.  see (2) above
  4943. Note that the field names referred to in a header record are, by default, the 
  4944. of the corresponding 
  4945. Powerbase
  4946.  fields, but may be changed to the 
  4947. descriptors
  4948. by altering the setting in the 
  4949. Print options
  4950.  window. 
  4951. Exporting data as a CSV file
  4952. Having set up your options as described above, creating a CSV file is very like printing a list. First highlight the fields to be exported by clicking on each with ADJUST. Remember that the order in which the fields are highlighted is important. If a default print selection exists (i.e. a file in 
  4953. PrintRes
  4954.  called 
  4955. !Selection
  4956. ) it will be used to determine which fields are exported provided no alternative selection has been made.
  4957. Next choose 
  4958. Export 
  4959. CSV file =>
  4960. Export
  4961.  (Ctrl X)
  4962. . A window featuring the 
  4963. Query panel 
  4964. appears. Type in a 
  4965. search formula
  4966.  to determine which records are exported. Finally, enter the name of the file and drag the file icon to a filer window. By default the file is saved in 
  4967. PrintJobs
  4968.  as usual, and you may simply click on the 
  4969. Export
  4970.  button or type Return. Experiment with saving 
  4971. CSV files
  4972.  with different settings of the 
  4973. CSV options
  4974.  and then loading the resulting files into 
  4975. Edit 
  4976. to examine them.  If you select the 
  4977. Reverse
  4978.  button on the Query panel the CSV file will be created in reverse order. (See also 
  4979. field-concatenation
  4980.  option (
  4981. see 3.2.2
  4982. ) applies.  This means that data which occupies separate fields in the 
  4983. Powerbase
  4984.  record need not do so in the exported CSV file.  By holding down Shift when selecting the field with ADJUST, the comma (or other separator) which would normally follow is suppressed until you select a field 
  4985. without 
  4986. using Shift.  A slightly problematic situation occurs when you concatenate a mixture of numeric and non-numeric fields with the 
  4987. In quotes
  4988.  option selected.  In such a case 
  4989. Powerbase
  4990.  will enclose the whole concatenated group within two sets of double quotes. e.g. NAME, Z, M and SYM from the 
  4991. Elements 
  4992. database would be exported, for actinium, as:
  4993. ACTINIUM 89 227 Ac
  4994. Spacer
  4995. see 3.10.2
  4996.  in the above instance it is the default setting of one space 
  4997.  is used to separate the concatenated fields. To export the displayed record only hold down Shift when starting the CSV export.
  4998. 8.3.1
  4999. Scrollable lists and CSV files
  5000. When you include a Scrollable list as one of the fields in a CSV file it will be written as a single CSV field if the format is selected in the Print options window is 
  5001. As single line
  5002. . The character used to separate data from different rows of the Scrollable list is set in 
  5003. Scroll term 
  5004. in the CSV options window and the default is a semicolon. The data from individual cells in the same row of the scrollable list are separated by the same CSV separator as is used between CSV fields.
  5005. The above description might seem confusing but will become clearer if you export data from the sample database 
  5006. Scroller
  5007.  using the default settings but with 
  5008. In quotes
  5009.  selected in CSV options. You will see that the entire Scrollable list from each record is enclosed in double quotes, between which the items from within each row are separated by commas, a semicolon marking the end of each row.  
  5010. A file exported in this way can be re-imported into a 
  5011. Powerbase
  5012.  database. You must ensure that the scrollable list data goes back into a scrollable list field, although it need not have the same number of columns as the one from which it was exported. If the new list has more columns than the old there will be one or more blank columns on the right hand side; if there are fewer columns data from the missing columns will be discarded. This closely resembles what happens when there are more or fewer 
  5013. fields
  5014.  in the database than in the one from which the file was exported (see 
  5015. 8.4.2
  5016. If you change the CSV printing format in Print options from 
  5017. As single line
  5018. As columns
  5019.  and export the CSV file again (in quotes as before) you will see the contents of 
  5020. each row
  5021.  enclosed in double quotes and separated by commas, the items from within each row being also separated by commas.
  5022. Exporting this second file 
  5023. without
  5024.  the quotes (or the first file if you first change Scroll term to a comma) will result in a file in which every single cell of the scrollable list appears as a separate CSV field, separated from the next by a comma. This might prove useful if transferring data from a database which contains a scrollable list to one which doesn
  5025. Transferring data from and to scrollable lists in 
  5026. individual
  5027.  records was covered in 
  5028. 2.6.4
  5029. Using 
  5030. CSV files
  5031. import data
  5032. If you drop a CSV file on the record window of an open database the CSV options window (see 
  5033. ) appears with the title changed to 
  5034. Import CSV file
  5035.  and some additional icons, one of which displays the pathname of the file.  Clicking on 
  5036. Import 
  5037. will make 
  5038. Powerbase
  5039.  try to create new database records from the file. If you decide not to do this you should click on 
  5040. Cancel
  5041. . If you do wish to import the data there are some important consideration which will now be explained.
  5042. 8.4.1
  5043. Ensuring that the correct options are selected
  5044. If the CSV file originally came from a 
  5045. Powerbase 
  5046. application the settings in the 
  5047. CSV options
  5048.  window need to be exactly the same as they were when the file was exported. The exception to this is the 
  5049. In quotes 
  5050. button which is shaded on import because 
  5051. Powerbase 
  5052. doesn
  5053. t need it. If the CSV file came from a PC or another RISC OS application you might have to load it into 
  5054. Edit 
  5055. to find out what 
  5056. separator 
  5057. terminator 
  5058. are used.  You will also probably need to set the filetype to &dfe (omit the 
  5059. ) as well.
  5060. There are three more option buttons at the bottom of the window. One causes each record to be displayed as it is imported. The import process is slower with this turned on but much more informative if you like to know how things are progressing. The second button, when selected, strips any trailing spaces in the imported data-fields. Some database programs pad all fields to their maximum length by adding spaces to the end of the data where necessary.  If you import such a file into 
  5061. Powerbase 
  5062. you will find that the caret will always be at the far right of the field even though visible characters do not fill the field, and some queries won
  5063. t work properly. Setting the 
  5064. Strip spaces
  5065.  button before importing the file overcomes the problem.  The third option button determines how 
  5066. Sequence number fields
  5067.  are handled.  If the button is ON imported sequence numbers are ignored and new ones assigned in accordance with the field
  5068. s sequence number counter.  With the button OFF sequence numbers from the CSV file are imported without alteration.
  5069. 8.4.2
  5070. Directing imported data to the correct fields
  5071. If no fields on the 
  5072. record 
  5073. window are highlighted (i.e. with ADJUST) and the CSV file does not contain a 
  5074. header record
  5075.  (see 
  5076. ) then the import process proceeds according to the following rules:
  5077. The first CSV field will be read into the first 
  5078. Powerbase 
  5079. field for which importing is allowed, This means any which can hold text (including External fields) or numbers and also check-boxes. Graphics fields, Buttons or fields which are merely labels will be ignored. The next CSV field will be read into the second 
  5080. Powerbase 
  5081. field and so on. 
  5082. If the end of the CSV record is reached before all the relevant fields have been filled (
  5083. data underflow
  5084. ) then the next CSV record will start a new 
  5085. Powerbase 
  5086. record, i.e. the reading won
  5087. t get out of step. It does not matter, therefore, if the CSV file omits null items 
  5088. at the end of a line
  5089. If all relevant fields are filled before reaching the end of the CSV record (
  5090. data overflow
  5091. Powerbase 
  5092. ignores the remainder of the line and skips to the beginning of the next CSV record before starting a new 
  5093. Powerbase 
  5094. record. This is also to keep the operation in step. 
  5095. There will be occasions when you don
  5096. t want to fill the 
  5097. Powerbase
  5098.  fields sequentially as just described. There are two ways of making the process more specific: 
  5099. Highlight the required 
  5100. Powerbase 
  5101. fields with ADJUST before starting the import.  Data will then be read only into the highlighted fields, all other fields being ignored. The order in which the fields are filled is the order in which you highlighted them.  The rules given above about underflow and overflow of data still apply.
  5102. Give the file a header record containing the 
  5103. descriptors
  5104.  of required fields in the 
  5105. Powerbase 
  5106. record.  There is nothing to prevent you from using 
  5107. Edit 
  5108.  to add such a header to a CSV file which did not originate from a 
  5109. Powerbase 
  5110. application. The format of the header is illustrated in 
  5111.  (5).  Importing then occurs just as if those fields were highlighted. The 
  5112. Print options
  5113.  window must reflect whether the 
  5114. descriptors
  5115.  of fields are used. 
  5116. Do not use both a 
  5117. header
  5118. highlighting.
  5119. 8.4.3
  5120. Importing data from plain text files
  5121. It was explained in 
  5122.  (4) that files created as described above (
  5123. can have separators other than a comma. If the file has been created using 
  5124. Powerbase
  5125.  CSV exporting facility it will have been given the file-type &dfe as if it was a true CSV file. If it comes from some other source it is likely to be of type &fff (Text). It can still be imported but caution is needed because there are other circumstances in which a text file might be dropped on the 
  5126. record window
  5127. . A properly-written 
  5128. script
  5129.  file (see 
  5130. Ch 12
  5131. ) would be recognised as such and therefore cause no problem, but any text file dropped onto the appropriate type of 
  5132. External field
  5133.  (i.e. a Text, 
  5134. Text Block
  5135.  or Remote field) would become linked to that field instead of being treated like a CSV file. If you are importing data from a plain text file and your record contains fields of the aforementioned types be sure to drop the file on the window background, not on the 
  5136. External field
  5137.  The appropriate window will then appear with the title 
  5138. Import text file
  5139. You are strongly advised to use proper 
  5140. CSV files
  5141.  if at all possible.  You could, in fact, use the filer to set the filetype of such non-standard files to &dfe (omit the 
  5142. ) so that the problem of 
  5143. Powerbase
  5144.  taking the wrong action doesn
  5145. t arise.  Be sure to use 
  5146. Options
  5147.  to set the correct field separator and record terminator though. 
  5148. 8.4.4
  5149. What if the imported data won
  5150. t fit?
  5151. There are two situations in which this can happen. The database might not contain enough free records to hold all the imported data and so you get a 
  5152. Database full when reading CSV file
  5153.  error. To avoid this either make sure the database is big enough before you start or place a suitable value in the 
  5154. Increment for expansion
  5155.  icon in the 
  5156. Change length window
  5157. .  The latter is accessible from the 
  5158. Utilities 
  5159. submenu of the iconbar menu (see 
  5160. The second situation is where an item is too long for the destined database field. When importing data 
  5161. Powerbase
  5162.  maintains a file called 
  5163. TooBig 
  5164. inside the database
  5165. PrintJobs
  5166. directory. Anything which won
  5167. t fit in the target field is instead written to this file together with information about where it was intended to go and an 
  5168.  character is placed in the database field to draw your attention to it. No writable 
  5169. Powerbase
  5170.  field may be longer than 246 characters and if an item of imported data exceeds this a note will be made in the 
  5171. TooBig 
  5172. file advising you to define an 
  5173. External field
  5174. Text Block
  5175.  or Text) for such data. After completing a CSV import operation it is advisable to look at the 
  5176. TooBig
  5177.  file to see if any remedial action is needed.
  5178. Using CSV files to modify existing records
  5179. Most database programs which support CSV import allow it to be used only for creating new records.  
  5180. Powerbase
  5181.  is unusual in that you can use a CSV file to modify 
  5182. existing 
  5183. records
  5184.   This capability should be used with caution since careless use can irrevocably garble a database.  There are three relevant radio buttons in the CSV options window. They are called 
  5185. Modify existing, With primary key
  5186.  and 
  5187. With record number
  5188.  and their actions are as follows:
  5189. Modify existing 
  5190. No new records will be created when a CSV file is dropped onto the record window.  The existing records will be accessed in the order determined by the current index and the new data will be merged into these records.  You should, of course, either use ADJUST to highlight the fields into which the data is to go or place a header in the CSV file specifying the field tags and then turn on the 
  5191. With header
  5192.  button (see 
  5193. 8.4.2
  5194. ).  If all the records are modified before the end of the CSV file has been reached a warning message is displayed.  Note that it is the 
  5195. s responsibility
  5196.  to ensure that the data in the CSV file is in the correct order since 
  5197. Powerbase
  5198.  has no way of telling which data is destined for which record and can only proceed sequentially.
  5199. With primary key 
  5200. This affects both export and import.  When you 
  5201. export 
  5202. data with this button selected  
  5203. each record of the CSV file includes the 
  5204. primary key
  5205.  of the 
  5206. Powerbase
  5207.  record. (Try creating a 
  5208. CSV file
  5209.  with and without this option set and compare the files using 
  5210. .)  When 
  5211. importing
  5212.  such a file 
  5213. Powerbase
  5214.  will attempt to locate records with the 
  5215. same 
  5216. primary keys
  5217.  as the records in the CSV file. If a matching key is not found a new record will be created to receive the data. If the key does exist then the CSV data goes into the same record, overwriting any data which the target fields already contain.  The option is only useful for transferring data between 
  5218. Powerbase
  5219.  databases which have the same primary key field(s) and structure.
  5220. t forget that 
  5221. Powerbase
  5222. , by default, allows duplicate primary keys so it is possible for the new data to go into the wrong record.  You shouldn
  5223. t trust this method of import unless you are sure each primary key is unique.
  5224. With record number 
  5225. This resembles the previous option.
  5226.  It allows data to be exported with the 
  5227. Powerbase 
  5228. record numbers included. Importing into another (or the same) database places the data in records having the same record numbers, again overwriting data which may already be present in the target fields.  This option is only useful for transferring data between 
  5229. Powerbase
  5230.  databases in which corresponding records have identical record numbers.  One use for it might be to export a set of data, load it into an editor and do some extensive searching-and-replacing, then put the modified data back into the original database.
  5231. When any of the above three buttons is selected, clicking 
  5232. Import
  5233.  will warn you what is about to take place and ask for con
  5234. rmation. If you cancel the operation the radio button will be deselected and the normal default (
  5235. Create new records)
  5236.  selected instead.
  5237. Importing data into validation tables
  5238. It was explained in section 
  5239.  that the contents of a validation table can be exported as a CSV file. You may also import data by dropping a CSV file onto the table. The Options window appears as described in 
  5240.  so that the appropriate separator and terminator can be selected if necessary. 
  5241. It is not possible to increase the number of rows or columns in a validation table by this method. Only those items for which a space exists will be imported; the rest are ignored. Over-long data items are truncated. If a CSV file is dropped onto a table with 
  5242.  columns than there are fields in the CSV record, one or more columns in the table will be left blank.
  5243. This facility makes it possible to convert an old-style (i.e. non-modifiable) validation table to a new-style (modifiable) one without having to re-type all the data. First export the data as a CSV file, then create a new table (which may have more rows and/or columns than the old one if you wish) and drop the CSV file onto it. If you give the new table the same name as the old one the former will overwrite the latter when the database is closed.
  5244. Creating a new, working database from a CSV file
  5245. There is an option button in the 
  5246. CSV options
  5247.  window called 
  5248. With field data 
  5249. which only becomes active when the 
  5250. With header 
  5251. button is selected. With the button selected the 
  5252. header record
  5253.  of a saved CSV file contains not only the field names but also the field lengths and types. Again it is suggested that you create a file and look at it in 
  5254. Each item in the header contains four items of information separated by | (vertical bar) characters. These are, in order:
  5255. the field type number (These may be examined in the file
  5256. !Powerbase.Resources.ValStrings.
  5257. the maximum length of the field in characters
  5258. the field descriptor
  5259. the field tag
  5260. The CSV separator, as used in the remainder of the file, is used to separate each of these groups from the next. Assuming the separator to be a comma the structure of the header is:
  5261. <type>|<length>|<desc>|<tag>,<type>|<length>|<desc>|<tag>,<type>|<length>|<desc>|<tag> ...
  5262. It is quite possible to take a CSV file from a non-
  5263. Powerbase
  5264.  source and add such a header to it by hand. The field-type can be omitted, in which case the type is set to 0 (Unrestricted) and remaining number is assumed to be the length. It is also possible to omit 
  5265. either
  5266.  the descriptor or tag, but not both. If only one string is supplied it will be used for both descriptor and tag. The minimum specification for each field is therefore:
  5267. <number>|<string>
  5268. You can force a null descriptor by putting two bar characters together (a null tag is, of course, not allowed):
  5269. <number>||<string>
  5270. A file created in this form is 
  5271. meant to be dropped onto the window of an open database. It should be dropped onto the 
  5272. Powerbase
  5273.  icon on the iconbar when no database is open. There is enough information in the header to enable 
  5274. Powerbase
  5275.  to convert the file into a 
  5276. functioning database
  5277. . All the fields will be ranged on the left of the 
  5278. record window
  5279. , one beneath another and the 
  5280. primary key
  5281.  will consist of the first four characters of the first field, but these characteristics can be changed if desired.  Don
  5282. t try to create databases containing 
  5283. Check-box
  5284. , Button or 
  5285. External field
  5286. s using this method; it
  5287. s only meant for the most basic type of database in which all fields are of the Editable class.
  5288. Other methods of exporting data
  5289. It was noted in section 
  5290. 2.5.2
  5291.  that the contents of a record field can be dragged by means of SELECT and dropped into another field, a writable icon in a dialogue box, an editor or wordprocessor, or a filer window. In the last case the data is saved as a text file named from the 
  5292. of the data field.
  5293. This drag-and-drop method can be extended considerably. If a number of fields are selected, as in a print selection, then dragging and dropping as above will transfer the whole selection to an editor, wordprocessor or to the filer (where it is saved as a file called 
  5294. Selected
  5295. ). You can
  5296. t transfer multiple fields between databases in this way though, and dragging such a selection to a writable icon transfers the first field in the selection only. When dragging a selection like this the pointer can either be over a field (not necessarily a selected one) or over the window background; it doesn
  5297. t matter.
  5298. An even more powerful extension is the ability to export 
  5299.  the exportable fields in a record by holding down Ctrl and dragging from anywhere in the record window. If you have two identical databases open this method 
  5300.  copy a record from one to the other as well as to editors, wordprocessors and the filer. 
  5301. The main menu has an entry 
  5302. Export selected
  5303.  which displays an ordinary Save box. This is an old feature of 
  5304. Powerbase
  5305. , now superseded by the drag-and-drop facilities described above apart from the fact that the older method lets you choose your own filename for saved data.
  5306. 08S    -
  5307. 0hV    -
  5308. Ch 9 
  5309.  Mail-Merging with 
  5310. Impression, Ovation 
  5311. Ovation Pro
  5312. Although the title refers to 
  5313. Mail-Merg
  5314.  the process to be described is more accurately termed 
  5315. Data-Merg
  5316.  since it is by no means limited to merging names and addresses into letters or labels; any kind of textual data from a 
  5317. Powerbase 
  5318. application can be merged into any kind of document in 
  5319. Impression
  5320. Ovation
  5321. (including 
  5322. Ovation Pro
  5323. or many other editors and wordprocessors. 
  5324. Mail-merg
  5325. ing with 
  5326. Ovation
  5327. Ovation
  5328. expects data for merging to be supplied as a CSV file. An example file (
  5329. Ovation
  5330. ) is supplied with this version of Powerbase. It was created from the 
  5331. Elements 
  5332. database and is intended to work with the sample 
  5333. Ovation
  5334. document 
  5335. OmergeTest
  5336. . Before attempting to create 
  5337. CSV files
  5338.  of your own you are recommended to read the 
  5339. Powerbase 
  5340. documentation on such files (see 
  5341. ). The process for 
  5342. mail-merg
  5343. ing with 
  5344. Ovation
  5345. is described below. 
  5346. 9.1.1
  5347. Preparing an 
  5348. Ovation
  5349. document for 
  5350. mail-merg
  5351. Ovation
  5352. has a very easy method of specifying where the merged data is to go into the document. Whenever you reach a point where you wish to insert a 
  5353. Powerbase 
  5354. field type 
  5355. Ctrl I
  5356. .  A window headed 
  5357. Merge tag
  5358.  will appear inviting you to enter a number. The number required is the field number in the CSV record (which is 
  5359. necessarily the field number in the 
  5360. Powerbase 
  5361. record). If, for instance, you wish to merge the second field from each line of your CSV file enter 2 and type Return. You will see that 
  5362. [Merge2]
  5363.  has been inserted into the text at the caret. Continue typing, inserting other fields as required. The fields do not need to be in numerical order (you can insert field 2 before you insert field 1) and the same field may be inserted many times. Styles and effects may be applied to the Merge tags. Load 
  5364. OmergeTest 
  5365. to see how this looks. 
  5366. 9.1.2
  5367. Merging the data from 
  5368. Powerbase
  5369. With 
  5370. OmergeTest 
  5371. loaded into 
  5372. Ovation
  5373. , open the main menu, go to the 
  5374. File 
  5375. submenu and choose 
  5376. Print
  5377. . Select the 
  5378. Mail merge
  5379.  option button and drag 
  5380. Ovation
  5381.  to the writable icon to the right of the button. The pathname of the file will appear in the icon. Click on 
  5382. and the document will be printed once for each record in the CSV file, merging new data into the document each time. 
  5383. Ovation
  5384. contains 10 records so if you just want to see the process in action without actually printing 10 sheets of paper set your printer manager to print to a file instead of to the printer itself. 
  5385. If you examine 
  5386. Ovation
  5387. you will see that each field is enclosed in quotes. This is only necessary of the fields contain literal commas (see 
  5388. ). Look at the first record, for example, and note the comma in 
  5389. (Gr.aktis,aktinos; ray or beam)
  5390. . Without the quotes 
  5391. Ovation
  5392. would interpret the comma as a field separator and the merging would get out of step for that record. 
  5393. Mail-merg
  5394. ing with 
  5395. Impression
  5396. Ovation Pro
  5397. The following description applies to 
  5398. Impression
  5399.  Publisher
  5400.  and 
  5401. Impression
  5402.  Style
  5403. . The older 
  5404. Impression
  5405.  and even
  5406. Impression Junior
  5407. is also supported. The name 
  5408. Impression
  5409.  may be taken to refer to any of these.
  5410. Direct communication and data-transfer between 
  5411. Powerbase 
  5412. Impression
  5413. Ovation Pro
  5414.  can take place without the need for a CSV file. This task is performed by a module called 
  5415. ImpulseII
  5416.  which Computer Concepts have placed in the public domain to encourage its adoption as a standard means of transferring data between RISC OS applications. The 
  5417. !Powerbase.Resources.Modules
  5418.  directory contains a copy of the 
  5419. Impulse
  5420.  module.
  5421. To use this method of data-transfer with 
  5422. Impression
  5423.  no preliminaries, other than the preparation of the document itself, are necessary but 
  5424. with 
  5425. OvationPro
  5426.  you must first do the following:
  5427. Open the 
  5428. Applets
  5429.  subdirectory inside 
  5430. OvationPro
  5431.  and copy the 
  5432. !Impulse
  5433.  applet into it. If your 
  5434. OvationPro
  5435.  is a recent version, supplied on CD, you will find this applet in the 
  5436. DavidPilling.Applets
  5437.  directory. 
  5438. The filer also needs to have 
  5439.  the 
  5440. !TransDDF
  5441.  filter which is in the directory 
  5442. DavidPilling.Filters
  5443.  on the CD. The 
  5444. !Boot
  5445.  and 
  5446.  files of this filter need to be modified to load ASCII DDF files as described in the 
  5447. !Help
  5448.  file.
  5449. 9.2.1
  5450. Preparing the document for merging
  5451. Type the document in the normal way but leave about three spaces, instead of one, between words  where data from a database is to be inserted. We need to insert at these points embedded 
  5452. merge tags 
  5453. which the wordprocessor will use to tell 
  5454. Powerbase 
  5455. what to transmit. 
  5456. Impression 
  5457. Ovation Pro
  5458.  employ their own methods, described in their documentation, for entering merge tags.
  5459. Powerbase 
  5460. does, however, have its own provision for 
  5461. inserting merge tags 
  5462. and you will find this by far the easiest way of preparing the document. Section 
  5463.  explained how fields can be dragged and dropped into a wordprocessor. If you hold down Shift and then drag and drop the effect is rather different. Open a blank 
  5464. Impression
  5465. Ovation Pro
  5466.  document and drag to it (without Shift) a field from a database, e.g. the NAME field from 
  5467. Elements
  5468. . The contents of the field, i.e. the name of whatever element is displayed, will appear in the document. If you repeat the operation with Shift held down what you will see is:
  5469. Impression
  5470.  the field tag in angle brackets, e.g. <NAME> *
  5471. Ovation Pro
  5472. , the string 
  5473. Merge 1
  5474.  in square brackets, i.e. [Merge 1]
  5475. These are the ways the applications use to show the presence of 
  5476. Impulse
  5477.  commands. The scheme used by 
  5478. Impression
  5479.  is more informative since it tells us what field will be merged. In 
  5480. Ovation Pro
  5481.  the number after 
  5482. Merge
  5483.  is increased by 1 every time a command is inserted. The procedure described inserts the 
  5484. Impulse
  5485.  command 
  5486. GetField
  5487.  into the document. During a merge operation the GetField command will be sent to 
  5488. Powerbase
  5489.  which will pass back the contents of the field specified for insertion into the document.
  5490. There are two other useful 
  5491. Impulse 
  5492. commands supported by 
  5493. Powerbase
  5494.  and these require an alternative method for their insertion into the document. From the main 
  5495. menu choose 
  5496. Insert 
  5497. merge tags
  5498. . The window which is displayed has a pop-up menu and bump icons to choose a field and a second pop-up menu to choose a command. First on this menu is 
  5499. GetField
  5500. , although you
  5501. ll probably find the method described above more convenient for inserting this command. Second is 
  5502. GetExpanded
  5503.  which can be used with fields linked to validation tables (see 
  5504. ) to insert data from any column of the table. A submenu enables you to choose the column. The default is 1 which is the 
  5505. second
  5506.  column of the table.
  5507. Merging usually produces one copy of the document per record. This isn
  5508. t always what we require: sometimes we want to merge data from several records into the 
  5509. same 
  5510. copy of the document. 
  5511. NextMatch
  5512. allows us to do this. Whenever a NextMatch command is encountered, 
  5513. Powerbase
  5514.  starts transmitting the data from the next matching record 
  5515. without
  5516.  issuing an instruction to print the document or start merging afresh. This opens up the possibility of producing very fancy 
  5517. Powerbase
  5518.  reports by merging many records into a suitably-formatted document. When inserting a NextMatch command it doesn
  5519. t matter what field you have displayed in the Insert merge commands window.
  5520. To actually insert a command into the document, first ensure that the correct field and command have been chosen, then place the caret at the required place in the document and drag the text file icon into the document from the Insert merge command window.
  5521. 9.2.2
  5522. Merging the data
  5523. Make sure the wordprocessor has been 
  5524.  by the filer then open the 
  5525. Powerbase 
  5526. database. 
  5527. Data merge
  5528.  on the main menu opens the Data merge window and the prepared document may then be dropped on either this window or on the record window. Choosing 
  5529. Data merge
  5530.  from the menu isn
  5531. t really necessary, however, since dropping the document on the record window will open the Data merge window anyway. 
  5532. If the wordprocessor isn
  5533. t already running 
  5534. Powerbase 
  5535. will run it for you.
  5536. Clicking on 
  5537. Merge 
  5538. extracts data from either the first record or, if the 
  5539. Merge from displayed record
  5540.  button is set, the currently-displayed record, and inserts it in the specified places in the document. You can see this happening if the relevant parts of the document are visible. Using the tool-pane to browse, search or change subfiles or keys now causes the accessed records to be merged into the document instead of being displayed in the record window. Each time a record is merged its data overwrites that from the previous record. When merging is in effect the default action button on the window says 
  5541. Merging
  5542.  instead of 
  5543. Merge
  5544. If your printer is on-line and the printer driver loaded you may print the document with the merged data by clicking on 
  5545. Print
  5546. .  If the 
  5547. Print all 
  5548. button is selected before 
  5549. Merge 
  5550. is clicked 
  5551. Powerbase
  5552.  will proceed through the database either from the beginning or, if 
  5553. Merge from displayed record
  5554.  is selected, from part-way through the subfile, merging each record in turn  and printing for each record a copy of the document containing the merged data. (See 
  5555. 9.2.1
  5556.  regarding the 
  5557. NextMatch
  5558.  command to modify this behaviour.)
  5559. More often than not you will want to print only those records with certain characteristics, but where do you enter a 
  5560. search formula
  5561.  to do that? The answer is to use a filter (see 
  5562. 2.3.3
  5563. ) to limit the merge to the records you
  5564. re interested in. With 
  5565. Print all
  5566.  selected, only the records matching the search formula will be printed.
  5567. It is also possible to control merging via a 
  5568. script file
  5569.  (see 
  5570. Ch 12
  5571. ). Only the two commands !FILTER and !MAILMERGE (in that order) will normally be required.
  5572. s very easy to intiate a merge operation and 
  5573.  remember you should have selected 
  5574. Print all
  5575. ! If this happens to you, click 
  5576. Stop merging
  5577. . The merged data is removed from the document and the default action button reverts to 
  5578. Merge
  5579. . You can then select 
  5580. Print all
  5581.  and start the merge again. 
  5582. Cancel
  5583.  has a similar effect to 
  5584. Stop merging
  5585.  but also closes the Data merge window. However, there is nothing to stop you reopening it from the main menu and resuming the merge process, provided the document is still open. 
  5586. During a merge operation (i.e. as long as the default action button says 
  5587. Merging
  5588. you are prevented from editing the document. Moving the pointer over an 
  5589. Impression
  5590.  document under these conditions makes it change to a large red and blue cross and the caret can
  5591. t be placed in the document. Over an 
  5592. Ovation Pro
  5593.  document there is no immediate indication but, as soon as you try to type anything, the message 
  5594. t edit. Merge active on this document
  5595.  is displayed. Both 
  5596. Cancel 
  5597. Stop merging
  5598.  remove
  5599.  the merged data from the document and normal editing is restored. If you 
  5600.  want to edit the document with merged data present then click on 
  5601. . Note, however, that if you save the document in this state it will be saved with the specific data you have merged into it rather than with the 
  5602. commands 
  5603. to merge data. 
  5604. Appendix A 
  5605. gives a full description of the 
  5606. Impulse
  5607. commands or 
  5608. methods
  5609.  which 
  5610. Powerbase
  5611.  understands.
  5612. Mail-merg
  5613. ing with other programs
  5614. If you use neither 
  5615. Impression
  5616. Ovation
  5617. you may still be able to use 
  5618. mail-merg
  5619. ing with your wordprocessor, but you will need to read the manual carefully to find out how. It will almost certainly involve a CSV, or similar, file in conjunction with some method of 
  5620. tagging
  5621.  the document (as described above for 
  5622. Impression
  5623. Ovation
  5624. ) to specify where in it the data is to be merged. 
  5625. * This feature does not seem to be supported by 
  5626. Ovation
  5627. prior to version 1.36 and it is to that version that this information applies. 
  5628. * In 
  5629. Impression
  5630. Impression Junior 
  5631. all merge tags appear in the document simply as 
  5632. <Merge>
  5633. , i.e. there is nothing to distinguish 
  5634. one from another. To see what the actual 
  5635. Impulse 
  5636. command looks like open 
  5637. Impression
  5638. Merge 
  5639. command window and place the caret immediately before the initial 
  5640. . The text of the command will then appear in the writable icon. 
  5641. Ch 10 
  5642.  Utilities
  5643. All the procedures described in this chapter will be found on the 
  5644. Utilities 
  5645. submenu of the iconbar menu, enabling you to examine and alter the structure of an existing database. Note that, if 
  5646. password
  5647. s have been set, you need to enter the database with the 
  5648. Manager
  5649.  level 
  5650. password
  5651.  to obtain access to this submenu. 
  5652. Changing the 
  5653. Primary Key
  5654. primary key
  5655.  of a database is determined when it is created but is not fixed for all time. The 
  5656. primary key
  5657.  choice
  5658.  displays the same dialogue box as was used for creating the 
  5659. primary key
  5660.  in the first place, but with the addition of two radio buttons, whose function is described below. The present 
  5661. key structure
  5662.  is shown. Simply alter it to what you require and click on 
  5663. Create 
  5664. or type Return.
  5665. The first of the two radio buttons (
  5666. Retain subfile structure
  5667. ) is selected by default, making the records appear in the same 
  5668. subfiles
  5669.  as before. Any subsidiary 
  5670. indexes
  5671. , therefore, will still be valid. If you deselect this radio button with ADJUST (i.e. have neither button selected) then all the records will be placed in the currently selected subfile and you will need to rebuild your subsidiary indexes.
  5672. Selecting the second button (
  5673. Restore deleted records
  5674. ) also places the records in the current subfile, but has the additional effect of recovering 
  5675. deleted
  5676.  records, i.e. records which are still lurking in the 
  5677. Database 
  5678.  but aren
  5679. t in the 
  5680. primary key
  5681. index
  5682. . You would need to use this option when the 
  5683. primary key
  5684. index
  5685.  is lost or corrupted. If the 
  5686. PrimaryKey
  5687.  file is actually missing both radio buttons are shaded in order to enforce this mode. Note that you cannot recover deleted records if the 
  5688. Blank record on deletion
  5689.  button is set in the 
  5690. Preferences
  5691.  window: the data has 
  5692. really
  5693.  gone for good in this case.
  5694. Altering the record format
  5695. Some changes can be made without rebuilding the database. How much you
  5696. re allowed to do depends on how old the database is since a change in the structure of the 
  5697. Database
  5698.  file, permitting far more latitude in changing the structure, came into effect with 
  5699. Powerbase v.8.21
  5700. . Databases created with earlier versions use filetype 
  5701.  for the 
  5702. Database
  5703.  file and a characteristic icon (also used for the 
  5704.  file) which used to bear a large 
  5705. . Databases created (or reformatted) with v.8.21 or later use a plain text file for 
  5706. Database
  5707. . The old icon is retained for the 
  5708.  file and, since this is now its only use, the letter has been changed from 
  5709. . (This means that old 
  5710. Database 
  5711. files viewed with a recent version of 
  5712. Powerbase
  5713.  also show an 
  5714. If the second choice on the 
  5715. Utilities
  5716.  submenu is 
  5717. Adjust format
  5718.  the database is an old one and only minor changes are possible by this method. Thus you can
  5719. t delete fields or add new ones. You 
  5720. re-position fields and change 
  5721. descriptors
  5722.  and 
  5723. tags. 
  5724. You can
  5725. t alter the 
  5726. data length
  5727. s (except in one case; see below), but you can alter the 
  5728. visible 
  5729. lengths of data fields by ADJUST-dragging the edge of the data icon. You can also change the field type 
  5730. within its class
  5731. , e.g. an Alphanumeric field could be changed to a Numeric one since both belong to the Editable class, or you could change a 2-state Check-box to a 3-state one, but you couldn
  5732. t change either into a Calculated field.
  5733. The only type of field where the data-length may be changed is a Scrollable list. Although classed separately from External field types it has much in common with them in that the data for each record is stored in a separate file. Editing the number of columns, the column widths and the number of visible rows is allowed even for old-type databases.
  5734. If the menu choice is 
  5735. Alter format
  5736.  the database structure is the more recent one. In addition to the changes described above you can add fields of the following types:
  5737. All tool-pane buttons
  5738. All extra buttons, including those which open directories, run files or insert calculated results
  5739. Textual labels. i.e. fields which consist of a descriptor only
  5740. All External field-types 
  5741. except Remote
  5742. Logos
  5743. Scrollable lists
  5744. When you choose 
  5745. Adjust/Alter
  5746.  format the Field definition window with the layout grid is displayed. Double-click on a field to edit it. Many of the options will be shaded, especially if the choice was 
  5747. Adjust format 
  5748. (old style database). When you have finished making the changes choose 
  5749. Quit design 
  5750. from the menu.
  5751. Rebuilding the database
  5752. This is more drastic, but it is not always possible to foresee future needs and you may have to introduce a new field or lengthen an existing one. That involves rebuilding the whole database. 
  5753. Powerbase
  5754.  actually builds a completely new database under another name, leaving your original database unchanged in case anything goes wrong, so this is a very safe procedure which you needn
  5755. t be afraid to experiment with.  Choose 
  5756. Rebuild database
  5757.  (old-style databases show 
  5758. New record format
  5759.  in the menu)
  5760. .  The Reformat database window will appear.  Several options are now available:
  5761. Enter the new database name and drag the database sprite to a filer window. You will then be offered the record layout for editing, as when creating a new database.  Make the required modifications then choose 
  5762. Quit design
  5763.  from the menu. This is the recommended method.
  5764. If you already have a 
  5765.  file in the new format drop it onto the Reformat window where its name will appear. Enter the new database name and drag the sprite to a filer window.
  5766. Create a new database shell (which must have a different name from the one to be reformatted) and copy your existing 
  5767. Form 
  5768. file into it.  Open this 
  5769. database
  5770. , edit the layout and save the 
  5771.  file.  Open the 
  5772.  database, call up the Reformat window and drop the new one onto it. Its pathname will appear in the window. Finally click on 
  5773. Reformat
  5774. . This was the method used in versions of 
  5775. Powerbase
  5776.  prior to 7.52 and, although it still works with the latest version, it should be regarded as obsolete.
  5777. Data from a field in the old database will be copied to a field in the new one with the same tag. The new database must therefore retain the same 
  5778.  as the old for data which is to be common to both. A tag present in the old database but not in the new is assumed to refer to a deleted field and the associated data is not transferred.  A field present in both databases but with a shorter defined length in the new one will have its data truncated if necessary. A tag present in the new database but not in the old is assumed to be a new field and will be left blank. Before proceeding 
  5779. Powerbase
  5780.  will inform you of any likely data loss due to deleted or shortened fields and ask you if you wish to proceed. When the process is complete you will be left with the new database open. Links to validation tables, calculation formulae, and indexes are preserved unless a relevant field was omitted from the new record.
  5781. Merely to convert old-style databases to the newer format choose 
  5782. New database format
  5783. , drag the icon from the Reformat window to a suitable directory and choose 
  5784. Quit design
  5785.  without making any changes. 
  5786. Merging two databases
  5787. Two databases may be merged provided they have identical record structures. With the first database open, select 
  5788. Merge database
  5789.  and drag the second database to the displayed window. The pathnames of both databases can now be seen. The pathname of the open database is duplicated in a writable icon labelled 
  5790. Save as
  5791. . If you accept this default the data from the second database will be merged into the open one. You can, however, change this name and drag the database icon to a directory window. The merged data will then go into a completely new database leaving both source databases as they were. When you click on 
  5792. Merge database
  5793. Powerbase
  5794.  will check that the two record formats are identical and report an error if they aren
  5795. t.  An option button determines the action taken with regard to Sequence number fields (see also 
  5796. 8.4.1
  5797. Two radio buttons are also present, as in the dialogue box for rebuilding the 
  5798. primary key
  5799. , and their functions are essentially the same (see 
  5800. ). Having the first button selected merges records into the same 
  5801. subfiles
  5802.  as those they occupy in the second database. Having neither selected merges records into the current subfile of the first database, regardless of where they are in the second database. Having the second button selected does the same, but also imports records which were 
  5803. deleted
  5804.  in the second database. 
  5805. Changing the 
  5806. Database Length
  5807. The number of available records in a database may be increased or decreased. 
  5808. Change length
  5809.  leads to a window with two writable icons. The first specifies the new database length, the other  determines the number of records by which the database will be lengthened each time it becomes full. If this value is zero no automatic lengthening occurs; a warning is displayed instead.  You will only be allowed to shorten a database if the surplus records have never been used or have been blanked on deletion.  Otherwise you can only get rid of them by exporting all the current records as a subset (see 
  5810. 13.2)
  5811. Inspecting and 
  5812. balancing index trees
  5813. Print 
  5814. index
  5815.  lets you examine the structure of the current 
  5816. index
  5817.  to find out how many 
  5818.  are present in each level. The ideal numbers in a perfectly-
  5819. balance
  5820. index
  5821.  tree are 1, 2, 4, 8, 16, 32, 64, 128 etc. (i.e. powers of 2, beginning with 2
  5822. A submenu gives you a number of options for printing the index details. You may print only the numbers of nodes in each level (with the ideal values listed above for comparison) or print the actual 
  5823. , positioned according to the level they occupy in the tree. The tree is printed sideways with a choice of two formats, 
  5824. Root first
  5825. Symmetrical
  5826. . The data may be printed for all subfiles of the current key or for the current subfile only. Output is to a screen window from which it may be saved in the same way as any other report. If you have printed the 
  5827.  themselves then double-clicking with SELECT on any key will retrieve the associated database record.
  5828. If the tree is very un
  5829. balance
  5830. d and, especially, if there is an enormous number of levels with only 1 or 2 
  5831.  in each, you are advised to 
  5832. balance
  5833.  it using 
  5834. Balance
  5835. index
  5836. Ctrl B
  5837. . The totals in each level are displayed after balancing. If you initiate the process with 
  5838. Ctrl Shift B
  5839.  the full tree structure is printed after balancing.
  5840. It is also possible to make 
  5841. Powerbase
  5842. balance
  5843.  the 
  5844. index
  5845.  automatically at regular intervals. To turn on auto-balancing choose 
  5846. Preferences
  5847.  from the iconbar menu.  Select the 
  5848. Balance
  5849.  every <n> records
  5850.  button, placing your chosen value of 
  5851.  in the writable icon provided, then click on 
  5852. Accept
  5853. Auto-balancing
  5854.  is most likely to be useful when a large number of records are being entered in primary-key order.  This will happen if you are entering data from a lot of forms in alphabetical order of name where name is the 
  5855. primary key
  5856. .  It is also very likely to happen when importing 
  5857. CSV files
  5858.  as these are often ordered according to the data item which becomes the 
  5859. primary key field
  5860.  of the database record.
  5861. Useful database details
  5862. Powerbase 
  5863. menu is headed by the 
  5864. Information
  5865.  entry which displays a window giving the numbers of records available and used, and the way the latter are distributed amongst the subfiles. (The subfile names are on action buttons which may be used to move to a chosen subfile.) A 
  5866.  button enables the information in this window to be saved as a text file.
  5867. Database details
  5868.  on the iconbar 
  5869. Utilities
  5870.  menu has its own submenu with two choices. 
  5871. Record data
  5872.  displays the same information as described above with a couple of useful additions: the record length in bytes and the number of fields in the record. 
  5873. Field data
  5874.  lists the field number, class, type, data-length, tag and descriptor for each field in the record. If you move the Report window out of the way so that the record window is visible you will find that double-clicking on a line in the report places the pointer over the middle of the field. This can be useful when finding your way around a complex record where many fields are without descriptors.
  5875. Finding 
  5876. duplicate primary keys
  5877. Wherever possible a 
  5878. primary key
  5879.  should be chosen so as to be unique. Where duplication of the 
  5880. primary key
  5881.  might occur the designer of the database can decide either to allow or forbid it (see 
  5882. 11.2.1
  5883. ). If duplicate 
  5884.  are permitted it is sometimes useful to have a list of them. Such a list is created by 
  5885. Find 
  5886. duplicates
  5887.  and may be saved as a text file.
  5888. 10.9 Libraries
  5889. Ch 15 
  5890. describes how  non-standard features can be added to a database by means of a 
  5891. customisation library
  5892. . Where possible all customised databases should occupy the directory specified by 
  5893. CustDir 
  5894. !Powerbase.Resources.Config
  5895. . The 
  5896. Libraries 
  5897.  choice on the 
  5898. Utilities 
  5899. submenu will list all the customisation libraries known to 
  5900. Powerbase
  5901.  at that time. The entry is shaded if none were found. Double-clicking on a line of the report opens the relevant 
  5902. Customisation
  5903.  directory for examination and editing.
  5904. icking 
  5905. 0D        -
  5906. * A poor choice of key, with many duplications of just a few values, inevitably leads to a tree with many levels in which each level is sparsely populated. An attempt to balance the tree under such circumstances may give very little improvement.
  5907. Ch 11 
  5908.  Passwords and related matters
  5909. Levels of protection
  5910. Powerbase
  5911.  provides three levels of 
  5912. password protection
  5913. . None of the sample databases uses 
  5914. password
  5915. s, so you may examine the 
  5916. password
  5917. -setting dialogue box which is accessed by choosing 
  5918. Set passwords
  5919.  from the 
  5920. Miscellaneous 
  5921. submenu. If passwords have been defined then an attempt to open the database leads to a request for a password.  This is not readable as you type it in; all the characters are replaced by hyphens. If 
  5922. Powerbase
  5923.  does not recognize the supplied password it beeps and prints an error message in red then prompts for the password to be re-entered. After three failed attempts 
  5924. Powerbase
  5925.  will shut down.
  5926. The lowest password level is 
  5927. . It is intended to let users examine the database but otherwise keep them out of mischief. A user opening a database with the 
  5928. Read 
  5929. password
  5930.  will be allowed to browse, search  and print reports (unless debarred as described in 
  5931. ), but not much else. In fact it will be found impossible to place the caret in a field. The function keys won
  5932. t work, many of the buttons on the tool-pane will be inactive and some menu items will be shaded. In particular, the whole of the 
  5933. Miscellaneous 
  5934. submenu is unavailable, thus preventing the user from getting at the other passwords!
  5935. The next level, 
  5936. Read/write
  5937. , allows more operations. Everything on the tool-pane is allowed, including altering, creating and deleting records. You may create indexes and create and edit validation tables. What you cannot do is change passwords or alter the size and structure of the database by means of options on the iconbar 
  5938. Utilities 
  5939. menu. 
  5940. The top level is 
  5941. Manager
  5942. . At this level you are allowed to set and alter passwords, as well as use all the iconbar menu options. Passwords may be up to 10 characters long and are normally case-specific. Note that when you are setting the two lower ones they can be read but the 
  5943. Manager 
  5944. password
  5945.  appears even here as a row of hyphens. Take care not to forget it! If no passwords at all are set you have full 
  5946. Manager 
  5947. rights so you may ignore the password facility altogether if you are the only user of the database. 
  5948. If you decide to use passwords you might not wish to use all three levels of protection and don
  5949. t need to do so. You may set a 
  5950. Manager 
  5951. level password only, leaving the other two blank. When you attempt to open the database in such circumstances the password-entry window appears because 
  5952. Powerbase
  5953. t read your mind and doesn
  5954. t know whether you
  5955. re the Manager and wish to enter your password or whether you
  5956. re a lower-level user being given limited access without needing a password. If the latter you would simply click on 
  5957. Open 
  5958. or type Return, thus entering a null password. This would give you 
  5959. Write 
  5960. access. If you set the 
  5961. Manager 
  5962. Read/write 
  5963. passwords then entering a null password would give 
  5964. Read 
  5965. access. 
  5966. It obviously makes no sense to set a low-level password and leave a higher level one blank! 
  5967. Powerbase
  5968.  prevents you from doing this in the following way. If there is a 
  5969. Read 
  5970. password but no 
  5971. Write 
  5972. password 
  5973. Powerbase
  5974.  makes the 
  5975.  and 
  5976. Write 
  5977. passwords the same. Similarly, if there is a 
  5978. Write 
  5979. password and no 
  5980. Manager 
  5981. password these two are made the same. This means that setting only the 
  5982. Read 
  5983. password makes all three identical. You are then admitted to 
  5984. Manager 
  5985. level when you enter this password 
  5986.  otherwise you could never get 
  5987. Manager 
  5988. level access again! The rule is that when two or more passwords are identical you are always given the higher level access when using that password. 
  5989. 11.1.1 Individual 
  5990. I.D.s and passwords
  5991. Access
  5992.  button makes it possible to assign a user an 
  5993.  and a 
  5994. personal password 
  5995. which allows access at one of the three levels described above. This gives even greater security by limiting access to those people who appear on a concealed list.  It does not seem appropriate, however, to describe the creation of such an 
  5996. access-control list
  5997.  in a manual for the general reader and the 
  5998. Access
  5999.  button is therefore shaded on copies of 
  6000. Powerbase
  6001.  as distributed. Anyone wishing to set up a secure database for use by a list of specified users is welcome to write for information to 
  6002. Powerbase
  6003.  Support, explaining their requirements.  
  6004. If a database is protected by an access-control list the password-entry window which appears when you attempt to open the database will display two writable icons instead of one. The first is for the user
  6005. s I.D., the second is for the 
  6006. password
  6007. . Enter both and click on 
  6008. . A an error in either the I.D. or the 
  6009. password
  6010.  will result in access being denied without informing the user which input contained the error. 
  6011. Options selected from the 
  6012. password
  6013. -setting window 
  6014. As well as the icons for the 
  6015. password
  6016. s you will see eight option buttons which may be used to enable or 
  6017. disable certain features of 
  6018. Powerbase
  6019. . They are placed here so that they may only be altered by someone who has 
  6020. Manager 
  6021. rights as that is the only access level which allows you to open this window. All the buttons except the last (
  6022. Log changes
  6023. ) are selected by default so that all the named features are enabled. If you deselect any of these buttons the feature concerned will cease to operate when you click on 
  6024.  and will remain inoperative every time the database is opened unless you set the button to re-enable it. 
  6025. The first four buttons determine the availability of the 
  6026. tool-pane
  6027. keypad
  6028. , the equivalent 
  6029. function keys
  6030. , the 
  6031. main menu
  6032.  and the 
  6033. iconbar menu
  6034. .  All these features are enabled by default but you may disable some or all of them in order to restrict the actions of other users of the database.  This subject is treated fully in 
  6035. Ch 14
  6036. The fifth button determines whether or not the exporting of 
  6037. CSV files
  6038.  and 
  6039. subset databases
  6040.  is allowed and the sixth does the same with regard to 
  6041. report printing
  6042. 11.2.1 
  6043. Duplicate primary keys
  6044. The seventh button determines whether the database is allowed to have 
  6045. duplicated primary keys
  6046.  or not. As mentioned elsewhere (see 
  6047. 4.5.2
  6048. ) the 
  6049. primary key
  6050.  should, ideally, be unique for each record. Sometimes the very nature of the data will make it so but, if this is not the case, you can enforce 
  6051. primary key
  6052.  uniqueness by deselecting this button. Any attempt to enter a record which would have a 
  6053. primary key
  6054.  identical to one which already exists will then result in an error message and the new record will not be placed in the file. 
  6055. If you decide to allow duplicate 
  6056. primary keys
  6057.  (and this is the default, remember) you might still want to be warned that such a key is about to be created and a button on the 
  6058. Preferences
  6059.  window allows you to enable or disable this feature. You can also make 
  6060. Powerbase
  6061.  print a list of duplicate primary keys (see 
  6062. The above refers only to the 
  6063. primary 
  6064. . Other, 
  6065. subsidiary
  6066.  which are generated when you create an 
  6067. index
  6068.  on some other field (see 
  6069. ) are 
  6070. subject to these restrictions and may be repeated many times. 
  6071. Logging database changes
  6072. Selecting the last option button (
  6073. Log changes
  6074. ) and clicking on 
  6075.  opens a log inside the database directory. 
  6076. Powerbase
  6077.  will then keep a record of when the database is opened and closed and details of changes made to the records. The following changes are logged, details in brackets showing what is recorded:
  6078. creation of a new record 
  6079. (record number & 
  6080. primary key
  6081. )      
  6082. deletion of a record
  6083. (record number & 
  6084. primary key
  6085. shifting a record to another subfile
  6086. (as above, plus old and new 
  6087. subfiles
  6088. changing a field in a record
  6089. (as above, plus old and new contents)  
  6090. changing a field in a group of records
  6091. (change, subfile and search formula)
  6092. creating an 
  6093. index
  6094. (name of new 
  6095. index
  6096. )         
  6097. balancing an 
  6098. index
  6099. (name of 
  6100. index
  6101.  concerned)        
  6102. changing the 
  6103. primary key
  6104. (former structure of key)         
  6105. reformatting the database
  6106. (fact only 
  6107.  no details)        
  6108. merging data from another database
  6109. (source of merged records)
  6110. importing 
  6111. CSV-type data
  6112. (source of imported data) 
  6113. As long as the 
  6114. Log changes
  6115.  button remains selected the 
  6116. log file
  6117.  will be opened whenever the database is opened. The title of the database is recorded and the 
  6118. password
  6119.  level at which entry was achieved. This takes the form of a number with the following meaning: 
  6120. password
  6121.  required, 1 
  6122.  read only,  2 
  6123.  read/write, 3 
  6124.  manager 
  6125. The date and time are also recorded.  When you close the database the date and time are recorded again and the 
  6126. log file
  6127.  closed. 
  6128. The log file is a plain text file and is always called 
  6129. .  Although the default location for the file is inside the database directory you may start a log somewhere else by dragging the small text-file icon next to the 
  6130. Log changes
  6131.  button to a directory display.  When you release the mouse button the password window is closed just as if you
  6132. d clicked 
  6133.  and logging is enabled. (It doesn
  6134. t matter whether you have selected the option button or not in this case; 
  6135. Powerbase 
  6136. will select it for you.) An advantage of this method is that you may perform the same drag to the same directory from many different databases and have them all use the same log.  The 
  6137. !Scrap
  6138.  application is a possible location for a general log of this kind.
  6139.  loads the log file into an editor for inspection. 
  6140.  only, 
  6141. Ch 12 
  6142.  Script Files
  6143. Powerbase
  6144.  incorporates a 
  6145. script language
  6146.  which enables you to control many features from a 
  6147. script 
  6148. . Using 
  6149. script
  6150. les you can automate jobs which need to be done frequently, print jobs and mail-merges being the most obvious examples. 
  6151. Script 
  6152.  are plain text 
  6153. les (created with 
  6154. StrongEd
  6155.  etc.) and are executed by dragging them to the 
  6156. Powerbase
  6157.  record window. All commands in a 
  6158. script
  6159. le must be in upper-case, preceded by 
  6160. , and may be followed by parameters (which are not case-sensitive), separated from the command by a single space. A description of all the commands follows. Parameters in square brackets are optional: in actual use the brackets are omitted. Where commands simply control the status of options buttons (e.g. !CASE, !UPPER) the parameter is either ON or OFF.
  6161. The !SCRIPT command
  6162. Since scripts are just text 
  6163. les there has to be a way for 
  6164. Powerbase
  6165.  to recognise them. All 
  6166. script
  6167. les must therefore start with a line beginning with the command 
  6168. !SCRIPT
  6169. . (or !
  6170. SCRIPT
  6171. POWERBASE 
  6172. if you want to be more speci
  6173. c, but !SCRIPT by itself is suf
  6174. cient). You may use !
  6175. SCRIPT
  6176.  END as the last line of the 
  6177. le but this is optional since the script will terminate anyway when the end of the 
  6178. le is reached. You can make the command 
  6179. chain
  6180.  another 
  6181. script
  6182. le by following it with the name of the new 
  6183. le, i.e. by using the form !
  6184. SCRIPT
  6185. lename> (see 
  6186. 12.1.1
  6187. ). When a script 
  6188. le is dropped onto the record window, or started by means of a button on the record window, its name will be displayed with a request for con
  6189. rmation that the 
  6190. le is to be executed. To suppress this request use !SCRIPT QUIET as the 
  6191. rst line.
  6192. If the 
  6193. PrintRes
  6194.  directory contains a script 
  6195. le called 
  6196. !Script it will be executed automatically
  6197.  when the database is opened.
  6198. 12.1.1 
  6199. Filenames in script commands
  6200. Many of the following commands take a 
  6201. lename as a parameter. If you just give a leafname 
  6202. Powerbase
  6203.  will look for it in the database
  6204. PrintRes
  6205.  directory. If it is stored anywhere else either the full pathname or a relative pathname must be supplied.
  6206. Where a script makes use of Selection, Print options, Query or other 
  6207. les which are relevant to only one database, the best policy is to store all these and the script 
  6208. le itself in the database
  6209. PrintRes
  6210.  directory and link the 
  6211. script 
  6212. le to a 
  6213.  button
  6214.  (see 
  6215. 4.2.13
  6216. ) on the record window. Dropping the script 
  6217. le onto the button will store the leafname of the 
  6218. le (if it is in 
  6219. PrintRes
  6220. ) or either the absolute or relative pathname (see 
  6221. 4.2.9
  6222. ) if it is elsewhere.
  6223. Clicking the Run 
  6224. le button with ADJUST will display the stored pathname.
  6225. When you click SELECT on a Run 
  6226. le button to which a text 
  6227. le is attached, 
  6228. Powerbase
  6229.  examines the 
  6230. rst line of the 
  6231. le. If this begins with !SCRIPT the 
  6232. le is executed as a script. If not the 
  6233. le is loaded for editing. To edit a script 
  6234. le linked to such a button click with Shift SELECT.
  6235. Commands used for reporting
  6236. Reporting
  6237.  is used here in its broadest sense for any operation capable of producing a 
  6238. le containing record data. Thus, creating CSV 
  6239. les and exporting single records are included.
  6240. !SELECTION
  6241. is used to select 
  6242. elds for inclusion in a report. If a 
  6243. lename is given as a parameter 
  6244. Powerbase 
  6245. looks for a print Selection 
  6246. le of that name and loads it, just as if you had double-clicked on it or dragged it to the record window. (See note above for the interpretation of 
  6247. lenames.) Alternatively, you may supply a comma-separated list of the tags of the required 
  6248. elds and may include the record number, key and sub
  6249. le number by placing the words RECORD, KEY and SUBFILE, respectively, in the list. If you supply no parameter at all the current selection will be cleared.
  6250. !SUBFILES
  6251.  <n>[,<n1>,<n2>...]
  6252.  selects the sub
  6253. le(s) which will be searched in order to create a report.
  6254. !CASE
  6255. turns the 
  6256. Case 
  6257. button on the 
  6258. Query panel
  6259.  ON and OFF. 
  6260. !QUERY
  6261. lename\]<
  6262. search formula
  6263. is used to print a report. It returns the same result as entering a 
  6264. search formula
  6265.  in the 
  6266. Match window
  6267.  and clicking 
  6268. Print
  6269. . If you 
  6270. rst issue a !DESTINATION FILE command you can use a list of !QUERY commands to create a batch of reports as text 
  6271. les. If you omit the optional 
  6272. lename each 
  6273. le will be created in 
  6274. PrintJobs
  6275.  using the search formula (or part of it) as the 
  6276. lename. If you supply a name containing $ it is assumed to be a full pathname and will be used to create the 
  6277. le. Any other name causes the 
  6278. le to be created in 
  6279. PrintJobs
  6280.  or in a subdirectory (which must exist) of 
  6281. Print Jobs.
  6282.  Note the backslash between the 
  6283. lename and search formula; this tells 
  6284. Powerbase
  6285.  where the one ends and the other begins. 
  6286. !CASE
  6287.   also affects the behaviour of this command if issued beforehand.
  6288. Instead of the search formula you may supply the name of a saved Query 
  6289. le. If this 
  6290. le is in 
  6291. PrintRes
  6292.  only the leafname need be given as noted in 
  6293. 12.1.1
  6294. An error message is produced if an attempt is made to execute !QUERY with the format set to Table or Label when Destination has not been set to Printer.
  6295. !PRINT
  6296.  prints the displayed record as a single-record report, just as if you typed Shift-Print or Shift SELECT clicked the Print button on the Match window.
  6297. !SAVE
  6298. lename>
  6299.  may be used to save a 
  6300. le which has been created in a window by a !QUERY command. When issued 
  6301. without
  6302. lename it uses whatever name the !QUERY command would use if the destination were File instead of Window, i.e. a name given in the !QUERY command or one based on the search formula, but any supplied name overrides this. !SAVE is also used to save single-record reports created with !PRINT. If no 
  6303. lename is given the 
  6304. le will be saved in 
  6305. PrintJobs 
  6306. under a name derived from the primary key or, if 
  6307.  is supplied as a parameter, as RecXXX, where XXX is the record number
  6308. !DUMP <
  6309. lename>
  6310.  has an effect similar to that of Ctrl-dragging with SELECT on the record window. It saves all exportable 
  6311. elds of the record as a text-
  6312. le in 
  6313. PrintJobs. 
  6314. Filenames are
  6315.  as for !SAVE
  6316. , i.e. derived from primary key if no parameter is given and RecXXX if parameter is 
  6317. lename\]<search formula>
  6318.  is similar to !QUERY but produces a CSV 
  6319. le instead. Once again, the name of a Query 
  6320. le may be supplied instead of a search formula. The CSV option settings are observed.  A prior !DESTINATION command is unnecessary in this case.
  6321. !INCLUDE
  6322. !EXCLUDE
  6323. !CLEAR
  6324. have the same syntax and may 
  6325. be treated together. They have the same effects as the controls on the Mark pane attached to the record window. !INCLUDE <key>[,<key>,<key>...] has exactly the same effect as ticking the check-box on the Mark pane for records with the associated primary keys. !EXCLUDE has the same effect as marking with a cross, which is what happens when the alternative option from the pane
  6326. s pop-up menu is chosen. !CLEAR selectively clears marks or, issued with no parameters, clears all marks. As an alternative to a comma-separated list of keys you may supply a 
  6327. lename. The 
  6328. le should be a plain text 
  6329. le with one primary key on each line. (See 
  6330. 12.1.1
  6331.  for the interpretation of 
  6332. lenames.)
  6333. Setting 
  6334. print options
  6335. !PRINTOPTS
  6336. lename>
  6337. loads a Print options 
  6338. le, setting the options just as if the 
  6339. le had been double-clicked or dragged
  6340. to the record window.  Remember that a Print options 
  6341. le contains all the settings for both the Print options 
  6342. Printer setup windows. Without a 
  6343. lename it sets the default options.
  6344. !DESTINATION
  6345.  <string>
  6346. where <string> is
  6347. Window, File or Printer sets the destination for report printing (see 
  6348. ).  If File is used the report is saved in 
  6349. PrintJobs
  6350.  unless a subsequent 
  6351. !QUERY
  6352.  command supplies an alternative pathname (see above).
  6353. !FORMAT
  6354.  <string>
  6355. where <string> is 
  6356. Horizontal
  6357. Vertical
  6358. , Label or Table sets the print format. If any other parameter is used, or !FORMAT is issued by itself, the 
  6359. Horizontal
  6360.  format is used.
  6361. !EXPAND
  6362. selects the  button which causes 
  6363. elds to be expanded by reference to a linked 
  6364. validation table
  6365. . !EXPAND OFF (or just !EXPAND by itself) deselects the button.
  6366. !DATE
  6367. turns date and time stamping ON and OFF.
  6368. !UPPER
  6369. forces upper-case printing ON, normal upper/lower case printing otherwise. 
  6370. !HEADER, !FOOTER
  6371. determine whether  
  6372. header/footer
  6373.  information (see 
  6374. 3.10.2
  6375. ) is printed on reports.
  6376. !FIRSTPAGE
  6377. when followed by ON causes the 
  6378. header
  6379.  to appear on the 
  6380. rst page only. (Footer information only appears on the 
  6381. nal page anyway.) N.B. This command was formerly called !FIRST, a name now used for a totally different command.
  6382. !SHRINK
  6383. determines whether surplus 
  6384. white space
  6385.  is removed from between the columns of reports in Horizontal format. 
  6386. !HEADINGS
  6387. causes 
  6388. descriptors
  6389.  to be used as 
  6390. eld identi
  6391. ers in a report. !HEADINGS T, or without any parameter, causes 
  6392.  to be used.
  6393. !TITLE
  6394.  <string>
  6395. uses <string> as a title on subsequently printed reports. 
  6396. !PAGE
  6397. sets the page length for reports to 
  6398.  lines (see 
  6399. 3.10.2
  6400. !SPACER
  6401.  <string>
  6402. speci
  6403. es the string to be used to separate columns of printed data in reports using 
  6404. Horizontal
  6405. Table format
  6406.  (see 
  6407. 3.10.2
  6408. !TEXTWIDTH
  6409.  speci
  6410. es the maximum width in characters for Memo and Text block 
  6411. elds in reports.
  6412. !SORT
  6413. speci
  6414. es a column on which the report is to be sorted before printing. The tag of a 
  6415. eld included in the report may be speci
  6416. ed instead of a column number. The !SORT must appear before !QUERY in the script 
  6417. le. It cannot be used when the output destination is File.
  6418. Setting 
  6419. printer setup options
  6420. !ORIENTATION
  6421. <orientation>
  6422. changes the paper orientation for hard-copy printing The default is 
  6423. portrait 
  6424. upright
  6425. , the alternative is 
  6426. landscape 
  6427. sideways
  6428. !PRINTCOLUMNS
  6429.  sets the number of columns used in printing a report when the Destination is Printer. n may be 2, 3 or 4. Anything else (including 0) is interpreted as 1.
  6430. !HEADERFONT
  6431. !BODYFONT
  6432.  <fontname>
  6433.  set the fonts for headers and footers and for body text in hard-copy printing. Names should be of the form Homerton.Medium, Trinity.Bold.Italic etc. The font must, of course, be known to the font-manager.
  6434. !FONTSIZE
  6435.  sets the size, in points, of the fonts used for hard-copy printing.
  6436. !LMARGIN
  6437. !RMARGIN
  6438. !TMARGIN
  6439. !BMARGIN 
  6440.  set the print margins for hard-copy printing. The units default to mm unless speci
  6441. ed by appending mm, in or pt to the number.
  6442. !PMARGINS
  6443.  cancels the margin settings in the Printer Setup window and uses the printer driver
  6444. s default margins instead. 
  6445. !LINESPACE
  6446.  sets the spacing between the baseline of one line of printed text and the next as a percentage of the font size. The default is 120%. For Table format 150% looks neater.
  6447. !TABLE
  6448.  <columns>,<width>,<rows>
  6449.  sets up the number and width of blank columns, and the number of blank rows at the end of the report, in Table format. Column width is in mm but may be changed as for margins (see above). You need not specify all the parameters; current values will be used if any are omitted. You may, for example, specify 6 blank rows and nothing else by using !LABEL ,,6. Note the commas.
  6450. !LABEL 
  6451. <n>,<w>,<h>,<str1>,<str2>,<s>,<su>,<bl>,ON/OFF
  6452.  determines the setup for label-printing where: n=number of labels across the page, w and h are the width and height of label (units may be speci
  6453. ed as for margins and column widths), str1 and str2 are the optional 
  6454. rst and last lines and s=number of label at which printing on 
  6455. rst page is to start. su and bl are 
  6456. eld tags. If 
  6457. eld bl is blank then 
  6458. eld su will be printed instead. The 
  6459. nal parameter speci
  6460. es whether the primary key is to be printed on the label. As with !TABLE you need only specify the values you wish to change, but watch those commas!
  6461. !COPIES
  6462. speci
  6463. es the number of copies to be printed.
  6464. Commands used mainly for editing
  6465. !STARTAT
  6466.  <tag>
  6467.  sets the 
  6468. eld at which editing begins and places the caret in that 
  6469. eld. If no parameter is given, or if the designated 
  6470. eld doesn
  6471. t exist or isn
  6472. t writable, editing starts at the 
  6473. rst writable 
  6474. !FIRST
  6475. !LAST
  6476.  !NEXT
  6477. !PREVIOUS 
  6478. may be used to move about the current sub
  6479. le and display records. The meanings of the commands are pretty obvious.
  6480. !DELETE
  6481.  <key>[,<key>,<key>...]
  6482. deletes record(s) having the supplied primary key(s). As an alternative to the key or key-list you may supply the name of a text-
  6483. le containing the required keys, one to a line. The 
  6484. lename will be interpreted as described above for !SCRIPT <
  6485. lename>. The command can delete records in any or all of the six sub
  6486. les, not just the current sub
  6487. !INSERT
  6488. is the counterpart of !DELETE. Useful in similar circumstances. In this case the command must occupy a line by itself and be followed by the record to insert, one 
  6489. eld to a line. It is the user
  6490. s responsibility to ensure that the lines are not too long for the database 
  6491. elds into which they are placed and that the number of lines following each !INSERT is the same as the number of 
  6492. elds in the record. Don
  6493. t forget to leave blank lines for empty 
  6494. elds!  Records will be inserted into the currently-selected sub
  6495. !MOVE
  6496.  has the same syntax as !DELETE but moves records from their present sub
  6497. le to the next in sequence, regardless of the currently-displayed sub
  6498. le; e.g. a record in sub
  6499. le 2 will be moved to sub
  6500. le 3.
  6501. !CHANGE
  6502. eld tag>,<old contents>,<new contents>[,<search formula>]
  6503.  allows global changes to be made. The command functions like the 
  6504. Global changes
  6505.  menu choice (see 
  6506. 2.5.5
  6507. !FILTER
  6508.  <search formula>
  6509.  has the same effect as entering a search formula in the Filter window. The Filter window isn
  6510. t opened but the Filter button on the tool-pane (or on the record screen if there
  6511. s a Filter button there) is turned on and the 
  6512. rst matching record is displayed. !FILTER on its own cancels the 
  6513. lter.
  6514. !FILTEROPEN
  6515.  <search formula>
  6516.  is identical to the above but also opens the Filter window.
  6517. !FIND <key>
  6518.  locates and displays a record using the key in the currently-selected index.
  6519.  <index name or number>
  6520. where the speci
  6521. ed index appears on the menu of loaded indexes will make that the currently active index. If no parameter is given the primary key index is selected.
  6522. !INDEX
  6523.  <tag> 
  6524. constructs an index on the 
  6525. eld whose tag is speci
  6526. ed. Used in this, simplest, way the number of characters, word-number and position (see 
  6527. 4.5.1
  6528. ) default to maximum 
  6529. eld-length, 1 and L respectively. You may specify these extra details by placing them after the tag and separating them with 
  6530. colons
  6531. , i.e. 
  6532. <tag>:<chars>:<word>:<pos>
  6533.  speci
  6534. es all four parameters. A key based on more than one 
  6535. eld (or using the same 
  6536. eld more than once) may also be de
  6537. ned, each individual 
  6538. eld-speci
  6539. cation being separated from the next by a 
  6540. semicolon
  6541. . e.g. the key based on surname and forename described in section 
  6542. 4.5.2
  6543.  (p.42) would be de
  6544. ned by:
  6545. !INDEX NAME:4:1:L;NAME:1:2:L
  6546. A further colon may be followed by a string consisting of some or all of the letters COPJ to select the icons for 
  6547. ase speci
  6548. mit null keys, 
  6549. ad with spaces and 
  6550. ustify numbers.
  6551. A single !INDEX command may create several indexes, each in turn becoming the currently-active index. 
  6552. Commas
  6553.  are used to separate individual index speci
  6554. cations. Using the 
  6555. Elements
  6556.  database, for example, (and specifying the indexes in the simplest possible way) the command:
  6557. !INDEX Z,GP
  6558. would index 
  6559. rst on the Atomic number (Z), then on the Group 
  6560. eld (GP) 
  6561. with the Z index active
  6562. . The database is left with GP as the active index and a report of the whole database shows the records ordered by Group but, within each group, the records are in order of Atomic number; a sort within a sort.  
  6563. Powerbase
  6564. remembers
  6565.  the names of the indexes created by the most recent !INDEX command and will delete them if you issue !INDEX with no parameters 
  6566.  very useful for temporary indexes.
  6567. Repeating operations 
  6568. using a loop
  6569. !LOOP
  6570.  <loop-counter or terminating condition>
  6571.  initiates a loop. If a positive number is entered as the parameter it is assumed to be the initial value of the loop-counter. The value is decremented every time !ENDLOOP is reached. 
  6572. !ENDLOOP
  6573.  marks the end of a loop. The terminating condition or loop-counter is tested whenever this command is reached and the loop terminates if either the condition is TRUE or the counter is zero.  
  6574. A loop may be terminated in four different ways:
  6575. (1) When the loop-counter becomes zero.
  6576. (2) By supplying 
  6577. MOUSE S
  6578. MOUSE A
  6579.  as the parameter to !LOOP and placing !WAIT (see below) inside the body of the loop. In the 
  6580. rst case the loop will terminate when you click SELECT, in the second when you click ADJUST.
  6581. (3) You may supply any single word of your choice as a parameter and include an input-requesting command (see 
  6582. ) in the loop body. Typing the speci
  6583. ed word into the input icon will terminate the loop. The word must consist of letters only 
  6584.  spaces, numerals and punctuation are not allowed 
  6585.  but it isn
  6586. t case-sensitive.
  6587. (4) By supplying a search formula as the parameter. This is only useful if records are being scanned within the loop, e.g. by a !NEXT command. The 
  6588. rst record to match the search formula will terminate the loop.
  6589. When a preceding !DATA command runs out of data. See !DATA (below)
  6590. If no parameter is given the terminating condition is set to TRUE so that the loop terminates after one iteration. This reduces the likelihood of the program being trapped in an endless loop, although this is still possible. 
  6591. By using the input-requesting facility (see 
  6592. ) inside a loop you can now include command sequences such as:
  6593. !LOOP stop 
  6594.   !FIND Key to look for?
  6595.   !PRINT
  6596.   !SAVE
  6597. !ENDLOOP
  6598. The script will keep requesting keys, looking up the records, creating single-record reports and saving them as RecXXX, RecYYY etc. until the user types 
  6599. !PAUSE
  6600.  pauses execution of a script 
  6601. le for <n> centiseconds.
  6602. !WAIT
  6603.  changes the pointer to a representation of the mouse with its SELECT button highlighted. Execution will continue only when a mouse button is clicked or a key pressed on the keyboard.
  6604. !DATA <param> [,<param>,...]
  6605.  is especially useful inside a loop. If, in a subsequent command, READ is supplied as a parameter it will be replaced by the 
  6606. rst parameter in the comma-separated list following !DATA. When a command next  has READ as a parameter it will be replaced by the next item in the !DATA list and so on until the list is exhausted. This is suf
  6607. cient to terminate the loop; there is no need to supply an explicit terminating condition.  The following script, based on the 
  6608. Elements
  6609.  database, will clarify the situation.
  6610. !DESTINATION FILE
  6611. !DATA GP=1,GP=2,GP=3
  6612. !LOOP
  6613.    !QUERY READ
  6614. !ENDLOOP
  6615. rst time around the loop the !QUERY READ command will be changed to !QUERY GP=1. Since the print Destination is File the resulting report will be created in 
  6616. PrintJobs
  6617.  under the default name GP=1. The second time round the command becomes !QUERY GP=2 and the third time it becomes !QUERY GP=3. The data list is then exhausted and the loop terminates. A search formula may contain commas, in which case the formula must be in quotes as in the example below. Note that the !DATA line must precede any command which READs from it.
  6618. If you wish to provide your own names for the reports these can also be included in the !DATA list, alternating with the search formulae:
  6619. !DESTINATION FILE
  6620. !DATA MainGps,"GP=0,1,2,3,4,5,6,7",Transition,GP=T
  6621. !LOOP
  6622.    !QUERY READ\READ
  6623. !ENDLOOP
  6624. On the 
  6625. rst cycle of the loop the READ before the backslash is replaced by MainGps and the READ after the backslash by "GP=0,1,2,3,4,5,6,7". See syntax of !QUERY (
  6626. 12.2) 
  6627. regarding inclusion of a 
  6628. lename with the command. Transition and GP=T replace the READs the next time.
  6629. Be careful not to make lines too long when using !DATA. The maximum allowed length of the whole line is 254 characters. You may, however, use a block of up to ten 
  6630. consecutive
  6631.  !DATA lines and read them all in one loop. If you need more than this you must place them in a separate block 
  6632. after
  6633.  the !ENDLOOP and then initiate another loop to read them.
  6634. Other commands
  6635. !IMPRESSION
  6636. is used in conjunction with !QUERY to generate a report in text-
  6637. le format, allows you to insert 
  6638. Impression
  6639.  commands at the start of the text-
  6640. le. A 
  6641. script
  6642.  may, for example, execute a series of !QUERY commands and the resulting 
  6643. les are to be all selected together and dragged into an 
  6644. Impression
  6645. document. 
  6646. To make each 
  6647. le go into a new frame you need to make each begin with {nextframe}. This can be achieved by placing the 
  6648. script
  6649.  command !IMPRESSION {nextframe} before the 
  6650. rst !QUERY. You do not, however, want {nextframe} to begin the 
  6651. le created, or the 
  6652. Impression
  6653. document will have a blank frame on its 
  6654. rst page. To suppress the effect on the 
  6655. le use: 
  6656. !IMPRESSION {nextframe} Not 
  6657. rst. 
  6658. There must be a space between the 
  6659.  and the 
  6660. , but the 
  6661.  string isn
  6662. t case sensitive.
  6663. !OBEY
  6664.  <string>
  6665. can be made to do anything which a *command can do. e.g. !OBEY Delete <
  6666. lename> will delete the named 
  6667. le. !OBEY <
  6668. lename> will attempt to *Run the 
  6669. le. By supplying the pathname of a 
  6670. Powerbase
  6671.  database you can close the existing database and open a new one.
  6672. !MAILMERGE
  6673. lename>
  6674.  performs a mail-merge with 
  6675. Impression
  6676. Ovation Pro
  6677. . The 
  6678. lename is that of the document into which the data is merged. A !FILTER command, issued 
  6679. before
  6680.  the !MAILMERGE, will restrict the merge to records which match the search formula.
  6681. !COMMENT <string>
  6682. may be
  6683. used to insert comments in a 
  6684. script
  6685. le. The rest of the line is ignored. 
  6686. !MESSAGE <string>
  6687. will display a user-de
  6688. ned message in a small window to keep the user informed of what
  6689. s happening during execution of a script. A numeral in the range 1-9 attached to the end of the message may be used to specify how long the message remains on screen. If no number is given the message remains until !MESSAGE is issued on its own. This closes the message window. 
  6690. The window is normally centred on the screen, which can be annoying when used in conjunction with the input-requesting facility. This also centres its window so that one window covers the other. Pre
  6691. xing the message with a number, followed by a comma, moves the window up or down. e.g. 50 will place it just above the input-request window, 
  6692. 150 will place it below. 
  6693. !DISPLAY <tag>,<num> 
  6694. enables auto-display of External 
  6695. elds and initiates auto-scan of the sub
  6696. le as if the 
  6697.  button had been pressed 
  6698. (see 
  6699. 4.2.10
  6700. ). The second parameter determines the interval between records: the bigger the number the longer the delay. It is not, however, an actual time. A value of 10 will 
  6701. ip through the records quite rapidly; 100 is much slower. If the numeric parameter is omitted the auto-scan is stopped and the auto-display feature is disabled. 
  6702. Requesting user 
  6703. input from script 
  6704. This is best illustrated with an example. 
  6705. !FILTER GP=1
  6706.  will use GP=1 as a search formula. However, 
  6707. !FILTER Search formula?
  6708.  behaves quite differently. A small window pops up saying 
  6709. Search formula?
  6710.  with a writable icon into which you enter the formula then click 
  6711.  or type Return. 
  6712. This applies to all script commands which take a parameter. Instead of supplying the parameter itself in the script, supply a prompt 
  6713. followed by a question mark
  6714.  and the parameter and will be requested and used with the command.  Why would you want to do this? You might use a script to print a report in Table format but not always want the same number of blank columns and rows. You can request these with !TABLE Columns?,,Extra rows?,. Note the double comma (column width is not changed) and the comma after 
  6715. Powerbase
  6716.  checks the parameter string for a concluding 
  6717.  which, if found, causes the 
  6718. whole
  6719.  string to be treated as a prompt. This is 
  6720. ne for commands like !TITLE which take only one parameter but those which take multiple parameters need the concluding comma. 
  6721. When requesting input to the !FORMAT command you need only enter the initial letter H, V, T or L as appropriate.
  6722. H    - 7
  6723. 0`        -
  6724. u    - 7
  6725. 0()    -
  6726. 0 a    -
  6727. 0xT    -
  6728. 0@&    -
  6729. 08^    -
  6730. Ch 13 
  6731.  Subset databases
  6732. Subset
  6733.  databases are fully-working 
  6734. Powerbase
  6735.  databases with exactly the same structure as the main database but containing only a selection of its records.
  6736. Creating a subset
  6737. Creating a 
  6738. subset
  6739.  is extremely simple. Choose 
  6740. Export subset
  6741.  from the main menu and you will see a window strongly resembling the one used to export 
  6742. CSV files
  6743. .  It features our old friend the 
  6744. Query panel
  6745.  into which you type a 
  6746. search formula
  6747.  which determines the records to be exported as a 
  6748. subset
  6749. It is then only necessary to enter a suitable filename and drag the database icon to a filer window. The default pathname creates the new database as 
  6750. Subset
  6751.  in the same directory as the parent database. You can accept this default by just clicking on 
  6752. Export
  6753.  or typing Return. Records are exported from the currently-selected subfile and will be placed in the corresponding subfile of the subset database.
  6754. You can export records from several subfiles, not just the current subfile, and they will be in the same subfiles in the subset database.
  6755. On opening the new database you will find that it functions exactly like the original but contains only the selected records. It is made just large enough to contain the selected records so you will need to increase its length (see 
  6756. ) if you intend to add any further records.
  6757. Using a subset to shorten a database
  6758. A database which has undergone a lot of deletions might have blank records scattered at random throughout its 
  6759. Database
  6760.  file and unused keys scattered at random throughout its indexes.  If a database has 100 available records of which only 50 are in use you might want to get rid of the surplus records but aren
  6761. t able to do so by the simple shortening procedure described in 
  6762. Ch 10.5
  6763.  because that only allows you to lop off the 
  6764.  of the database.  The amount by which the database can be shortened is often much less than the number of in-use records would suggest: in extreme cases you might not be able to shorten it at all by this method.  (Don
  6765. t be afraid to try, however.  
  6766. Powerbase
  6767. t let you butcher your database; it just  tells you you can
  6768. t do it.)
  6769. The solution to the problem is to export 
  6770.  the records as a subset.  Simply follow the instructions in 
  6771. , with all occupied subfiles selected in the Query panel, but don
  6772. t type anything into the query panel.  The resulting subset will contain the 50 in-use records and no extras at all.
  6773. Ch 14 
  6774.  User choices
  6775. This chapter describes things you can do to influence the way 
  6776. Powerbase
  6777.  looks and functions.
  6778. Preferences
  6779. The largest group of user-defined choices is that controlled by the Preferences window, which is opened from the iconbar menu. Several of these choices have been mentioned in previous chapters but a full description of the window is provide here for completeness.
  6780. 14.1.1 Control
  6781. This refers to the framed portion of the Preferences halfway down the right-hand side, and we will begin with this because the settings chosen have an important bearing on what you see on opening a database and how you move around and edit records. The 
  6782. ve buttons in this section have an instant effect so you can readily see what they do. If the tool-pane/keypad has been disabled from the Passwords window (see 
  6783. ) then all 
  6784. ve buttons are shaded.
  6785. The three radio buttons enable selection of the 
  6786. tool-pane
  6787.  or the alternative 
  6788. keypad
  6789.  (see above) or neither. In the last case there should be control buttons on the record window.
  6790. New sprites
  6791.  is shaded when the keypad selected, but can enable a set of alternative symbols (with left 
  6792.  right-pointing arrows) for the tool-pane or record window where some buttons, such as Single-step, do duty for  two keypad buttons.
  6793. Rev. mouse
  6794.  reverses the action of the left and right mouse buttons. It only becomes unshaded when New sprites are selected since it then seems very logical to click the left button to produce the action indicated by the left-pointing arrow and the right button for the action indicated by the right-pointing arrow. e.g. on the Single step button ADJUST would display the next record and SELECT the previous record 
  6795.  the opposite to normal. The blue sprite on the Single step button is replaced by a red one as a visual indication that the mouse-button actions are reversed.
  6796. The keypad has button-pairs for several functions which, on the tool-pane, are served by single buttons clicked with SELECT and ADJUST, e.g. there is both a 
  6797. next record
  6798.  and 
  6799. previous record
  6800.  button instead of the dual-function Single step button on the tool-pane. Even so, clicking ADJUST on the paired buttons still reverses the action of SELECT.
  6801. The most frequently used buttons on the keypad are those on the top two rows, and clicking the toggle-size icon (top right corner) reduces the keypad to these rows only. Note that there is a close icon (top left). If you do close the keypad it can be re-opened with 
  6802. Show keypad 
  6803. on the main menu (or with the 
  6804.  key).
  6805. 14.1.2 
  6806. Separators in date and time fields
  6807. By default Date fields have the format dd-mm-yy or dd-mm-yyyy, i.e. they use a hyphen as a separator. Time fields have the form hh:mm:ss, i.e the separator is a colon. These defaults may be changed by entering your preferred separators in the two writable icons in the Separators section at the top of the Preferences window and clicking 
  6808. Accept.
  6809.   Note that when entering dates or times into these field types you may actually type any non-numeric character you wish as a separator. On moving to another field 
  6810. Powerbase
  6811.  will re-format the date or time to use the separator specified in Preferences.
  6812. 14.1.3 Wild-cards
  6813. The use of 
  6814. wild-card characters
  6815.  is described in 
  6816. 2.5.5
  6817.  and 
  6818. 3.5.3
  6819. .  By default 
  6820.  represents a single character and 
  6821.  a group of characters which need not be matched.  You may change either or both 
  6822. wild-card
  6823.  characters if you wish in the same way as described above for date and time separators.
  6824. 14.1.4 Option buttons
  6825. The descriptions given below refer to the action taken when the buttons are selected.
  6826. Record edits as CSV file
  6827. causes a CSV file called 
  6828. NewDataXX
  6829.  to be created in 
  6830. PrintJobs
  6831. . New and edited records are saved in this file which may then be used to enter data into another database. XX is a 2-digit number which is incremented each time the database is opened so that the results of successive editing sessions are saved as 
  6832. NewData01, NewData02
  6833.  etc.
  6834. Launch new copy
  6835. causes another copy of 
  6836. Powerbase 
  6837. to be loaded when you double-click on a database, instead of closing the current database. This can be useful if you want to access several databases at once, as one copy of 
  6838. Powerbase 
  6839. only supports the use of a single database. If there is a dormant copy of 
  6840. Powerbase 
  6841. on the iconbar (i.e. one with 
  6842. No data
  6843.  under its icon) then double-clicking a database sends it to that copy rather than launching a new one. With the button OFF double-clicking on a database closes down an already-open database before opening the new one. Even then you can load multiple copies of 
  6844. Powerbase 
  6845. by double-clicking on 
  6846. Powerbase 
  6847. itself and then open a different database in each by dragging the databases to the icons. 
  6848. Case-sensitive queries
  6849.  makes operations involving the Query panel take account of the case of letters.
  6850. Recalculate on opening
  6851.  causes 
  6852. Powerbase
  6853.  to scan the whole file when the database is first opened, updating any 
  6854. Computed field
  6855. s (see 
  6856.  and 
  6857. ) whose associated formulae make use of the system variable TIME$. Those Computed fields which are analogous to time-related Stamp fields (see 
  6858. 4.2.10
  6859. ) are also updated. With the button deselected the contents of such fields are recalculated only when a record is displayed, which might not be good enough where, for example, TIME$ is used in a 
  6860. User function
  6861.  (see 
  6862. ) to keep track of people
  6863. s current ages.
  6864. Blank record on deletion
  6865.  causes the relevant record to be over-written with a blank record when its key is deleted from the primary key index. With the button deselected deleting a record from the database merely removes all references to its key from the index, leaving the actual record data untouched in the 
  6866. Database 
  6867. . Although such 
  6868. deleted
  6869.  records will be overwritten when new records are entered, the situation may be deemed unsatisfactory from a security point of view since the 
  6870. deleted
  6871.  records can be examined by simply loading 
  6872. Database 
  6873. into 
  6874. Keep descriptor with data 
  6875. affects the moving of fields during record design, making the descriptor jump to its 
  6876. normal
  6877.  position to the left of the data field as soon as you release the mouse button after dragging the latter. As noted in 
  6878. 4.2.1
  6879. , the descriptor may be moved independently 
  6880. after 
  6881. the data field has been positioned but, even so, some users find this repositioning of the descriptor a nuisance and like to turn it off.
  6882. Validate input
  6883. enables data 
  6884. validation
  6885.  (see 
  6886. ).  If you ever find yourself unable to escape from a field linked to a 
  6887. validation table
  6888.  you can bring up the 
  6889. Preferences
  6890.  window, deselect this button and try again. You can also toggle validation ON and OFF with 
  6891. Shift-F9
  6892. . The 
  6893. Table
  6894.  button on the tool-pane is shaded when validation is disabled.
  6895. Display linked table data
  6896. displays a window showing data from the relevant 
  6897. validation table
  6898.  row every time the caret enters a field with a link to a 
  6899. validation table.
  6900.  This is either useful or infuriating, depending on your point of view. If turned off you can still call up the window for a specific field by double-clicking on the field with SELECT (see 
  6901. Warn of external deletion
  6902. displays a message warning that you are about to delete the file linked to an 
  6903. External field
  6904.  (see 
  6905. 2.6.3
  6906. Warn of duplicates
  6907. The creation of records with identical 
  6908. primary keys
  6909.  can be prohibited if so desired (see 
  6910. 11.2.1
  6911. ). Normally, however, they are permitted. You may, if you wish, turn this button ON to issue a warning that such a record is about to be created.
  6912. Default action on Return
  6913. According to the Style Guide for RISC OS typing Return anywhere inside a dialogue box ought to have the same effect as clicking on the default action button (that
  6914. s the one with the yellow channel border) regardless of which writable icon the caret is in. If that
  6915. s what you want then select this button. Many users (including the author!) 
  6916.  it and prefer the default action to take place only if the caret is in the last writable icon when Return is typed. Hence the default setting, which is OFF.
  6917. Strip leading spaces
  6918. causes spaces at the beginning of data fields to be stripped before the record is written to the file.
  6919. Strip trailing spaces
  6920. causes spaces at the right of data fields to be stripped. Such spaces are usually the result of pressing the space-bar by accident when entering data quickly and are therefore unwanted.
  6921. Balance every <n> records
  6922. forces rebalancing of the current index at regular intervals. The need to 
  6923. balance
  6924. indexes
  6925.  and the use of this option is explained in 
  6926. Remember place in subfile
  6927. ensures that, when hopping between subfiles, the first record displayed is the one you were looking at the last time you examined that subfile. With the button deselected the 
  6928. first 
  6929. record in a newly-selected subfile is always displayed.
  6930. Save marked status
  6931.   saves a list if records which are marked for printing etc, together with the include/exclude status (see 
  6932. Auto-open user menus
  6933. causes field-linked user-menus to open whenever the caret enters the associated data field, without the user needing to click the menu button.
  6934. Re-load last report
  6935. causes the last-saved report from a window to be automatically re-loaded and displayed on opening he database.
  6936. Query by example
  6937.  has already been described in section 
  6938. in connection with creating reports. If selected it is active for 
  6939.  operation for which you would otherwise type a search formula into the Query panel, i.e:
  6940. all operations (printing, counting, setting/clearing marks) involving the Match window
  6941. using a 
  6942. global changes
  6943. batch move/delete
  6944. subset export
  6945. csv export
  6946. interconverting relative and absolute pathnames for Remote objects
  6947. When any of the above functions is invoked with QBE enabled, a blank record is displayed for the entry of target values. The usual dialogue box also appears but with the writable icon shaded on the Query panel. After entering the values to be matched the default action button on the dialogue box is clicked as usual. If ADJUST is used, so that the window stays open, the next click on the default action button presents the blank record again for new target values to be entered.
  6948. 14.1.5 
  6949. Save indexes
  6950.  (Default: Manual)
  6951. Indexes
  6952.  are 
  6953. always 
  6954. saved whenever you close a database or quit 
  6955. Powerbase
  6956.  and only fear of power cuts or system failure (which includes some kind person switching off your computer!) need make you concerned about saving them yourself. With the 
  6957. Manual
  6958.  setting nothing happens during normal working unless you click 
  6959. Update
  6960.  on the tool-pane. Selecting 
  6961. Automatic
  6962. Warn only
  6963.  allows you to type in a suitable time interval (default = 10 min) at which 
  6964. Powerbase 
  6965. will either issue a warning to save your 
  6966. indexes
  6967.  (using 
  6968. Update
  6969. ) or actually save them for you.
  6970. 14.1.6 
  6971. Start editing at
  6972. When a record is displayed the caret is placed, by default, in the first editable field.  Editing may be made to start at a different field by choosing 
  6973. Start editing
  6974.  from the 
  6975. Field
  6976.  submenu (see 
  6977. 2.5.4
  6978. ) or, alternatively, by placing the caret in the required field and typing 
  6979. Ctrl @
  6980. .  The tag of the relevant field is stored in this writable icon in the 
  6981. Preferences
  6982.  window and can be saved along with the other preferences.
  6983. 14.1.7 Application for 
  6984. Impulse
  6985. data-merg
  6986. As noted elsewhere (
  6987. Powerbase
  6988.  can merge directly into a suitably-formatted 
  6989. Impression
  6990. document by simply dropping the document icon onto the 
  6991. record window
  6992. . The dialogue box which then appears contains a writable icon which shows the application with which 
  6993. Powerbase
  6994.  will merge. This name  is, by default, 
  6995. Impression
  6996. , but may be altered by users for their own purposes. An application which will receive data from 
  6997. Powerbase
  6998.  in this way must make use of the 
  6999. Impulse
  7000. II protocols as defined by Computer Concepts. Even if you are using 
  7001. Style 
  7002. Publisher 
  7003. the name to which these applications respond is still 
  7004. Impression
  7005. When using 
  7006. Ovation Pro
  7007.  you may, if you wish, alter this entry accordingly but it isn
  7008. t actually necessary; 
  7009. Powerbase
  7010.  can tell from the type of the document dropped onto the record window whether you are using 
  7011. Impression
  7012. Ovation Pro
  7013. 14.1.8 Save choices
  7014. This section of the window offers two ways of saving the settings 
  7015.  three if you are using RISC OS 3.5 or later. See 
  7016. 14.11
  7017.  for a description of how these options work and the effect of the 
  7018. Load defaults
  7019.  button. The same ideas apply to any window from which choices may be saved and reloaded.
  7020. CSV options
  7021. Section 
  7022.  explains how to access the 
  7023. CSV options
  7024.  window and what the pop-up menus and option buttons are for.  The buttons for saving your choices work in the exactly same way as described above for Preferences, as do 
  7025. Accept
  7026. Cancel
  7027. , and 
  7028. Load default
  7029. . The file is saved
  7030.  as a plain text file called 
  7031. CSVoptions
  7032.  with the same choices of location as described above for 
  7033. Preference
  7034. Print and Printer setup options
  7035. These are described at some length in 
  7036. , especially in 
  7037. 3.10.2
  7038. . All that needs to be said here is that the Save buttons work like those on the Preferences and CSV options windows except that, when saving choices for an individual database, you are offered a standard Save box and given the opportunity to give your own name to the file
  7039. and save it wherever you like, the default being in 
  7040. PrintRes
  7041. . It is anticipated that most users will have a need for several different print options files, differently named, for different ways of reporting from the database. Remember that a file called 
  7042. !PrintOpts
  7043.  saved in 
  7044. PrintRes
  7045.  will be used as a default if no other settings are made. 
  7046. Powerbase
  7047.  own default file is 
  7048. !Powerbase.Resources.!PrintOpts. 
  7049. You are reminded again that the choices in both windows are saved in a print options file.
  7050. Layout grid options
  7051. These are more or less self-explanatory and are saved as a data file 
  7052. GridOpts
  7053. !Powerbase.Resources
  7054. . No provision is made for saving files for individual databases, but if using RISC OS 4.33 you may save choices for an individual user.
  7055. Colours of key fields
  7056.  and table-linked fields
  7057. These may be selected in a window reached by choosing 
  7058. Colours
  7059.  from the 
  7060. Miscellaneous
  7061.  submenu. The following default colours are used:
  7062. Foreground
  7063. Background
  7064. Descriptor
  7065. key field
  7066.  (inactive)
  7067. dark blue
  7068. light grey
  7069. Descriptor
  7070. key field
  7071.  (active)
  7072. light grey
  7073. Data icon of 
  7074. primary key field
  7075. (s)    
  7076. black
  7077. pale yellow
  7078. Data icon of field linked to 
  7079. validation table
  7080. dark green
  7081. white 
  7082. Data icon of mandatory field
  7083. white
  7084. Clicking with SELECT on the 
  7085. descriptor
  7086.  and data icons within this window makes either the foreground or background (depending on the setting of the two radio buttons) cycle through the available colours. Clicking with ADJUST cycles through the colours in the opposite direction. The effect of the changes can be seen immediately.
  7087. Choices are saved as a file called 
  7088. FieldCols
  7089.  and the options are the same as for 
  7090. Preference 
  7091. Defining the function keys
  7092. Any button on the tool-pane or 
  7093. keypad
  7094.  may have its action duplicated by one of the 
  7095.  F1-F11, with or without the use of Shift or Ctrl. Point at the button to which you wish to assign a key and click MENU to display the Keystroke window, which
  7096.  shows the present key-assignment, if any. Use the 
  7097.  icons to select the required function key and, if desired, select one of the buttons for Shift and Ctrl. Click on the 
  7098. Assign
  7099.  button and you will now find that the assigned key exactly mimics the action of the button. 
  7100. In three instances 
  7101. Powerbase
  7102.  will automatically assign keys with Shift for you:
  7103. The shifted version of the key assigned to the 
  7104. Search 
  7105. button will be assigned to the 
  7106. search all subfiles
  7107.  function (see 
  7108. 2.3.1
  7109. The shifted version of the key assigned to the 
  7110. record button will be assigned to the Copy record function (see 
  7111. 2.5.3
  7112. The shifted version of the key assigned to the 
  7113. Table 
  7114. button will be assigned to the 
  7115. toggle validation on/off
  7116.  function (see 
  7117.  and 
  7118. 14.1.4
  7119. You may save your key definitions by clicking 
  7120. Save choices
  7121. and you will find them operative next time you use 
  7122. Powerbase
  7123. . As with the grid options (
  7124. ) there is no provision for saving keystroke de
  7125. nitions for individual databases but (under RISC OS 4.33) they may be saved for your personal use (see 
  7126. 14.11
  7127.  The default 
  7128. keystroke
  7129. s (together with some which duplicate other actions) are listed in 
  7130. Appendix B
  7131. .  If they have been redefined you may restore the defaults by clicking 
  7132. Load d
  7133. efaults
  7134. . If you wish to 
  7135.  the redefined 
  7136. keystroke
  7137. s permanently you should restore the defaults as described then 
  7138. Save choices
  7139. List 
  7140. displays all the key definitions (including those for additional functions) in a window from which the information may be saved as a text file.
  7141. Function keys
  7142.  may also be used to enter data into record fields or writable icons in dialogue boxes.  The actual programming of the keys is done at the command line which is accessed by pressing f12. This takes you temporarily out of the desktop and gives you a 
  7143.  prompt at the bottom of the screen.  Suppose you want to program f3 to enter the word 
  7144. Powerbase
  7145. .  Type, at the star prompt:
  7146. Key3 Powerbase
  7147. and press Return twice to return to the desktop.  The string assigned to the key may be entered by typing 
  7148. Ctrl Shift F3
  7149. .  Any of the keys 
  7150. F1-F9
  7151.  may be programmed and the string is always entered by typing the key with Ctrl and Shift both held down.
  7152. Overall control of the database
  7153. Powerbase 
  7154. database is normally controlled in four ways:
  7155. mouse-clicks on the 
  7156. tool-pane or keypad
  7157. keystroke
  7158. s which mimic the actions of the above
  7159. choices from the 
  7160. main menu
  7161. choices from the 
  7162. iconbar menu
  7163. Each of these can be disabled by deselecting one of the option buttons on the Password window (see 
  7164. ).  The main reason why you might want to do this is to provide limited facilities to someone else who is using your database.  It doesn
  7165. t, on the face of it, make a lot of sense to disable both the tool-pane 
  7166.  the 
  7167. keystroke-equivalents
  7168.  since no browsing or editing would then appear to be possible. You can, however, place some or all of the tool-pane buttons on the record window itself (see 
  7169. 4.2.13
  7170. ) thus allowing you to choose what functions you want to allow access to.  You might, for example, wish to provide only the 
  7171. Single-step
  7172.  and 
  7173. Search
  7174.  buttons.  Define these as 
  7175. Button field
  7176. s at the time the record is being designed then disable the tool-pane (or keypad) and keystroke equivalents. Other buttons in the 
  7177. Password window
  7178.  enable you to stop the user printing reports or exporting data as 
  7179. CSV files
  7180. subset
  7181. Config
  7182.  files
  7183. The plain text file 
  7184. !Powerbase.Resources.
  7185. Config
  7186.  determines certain aspects of the program
  7187. s operation which will seldom need changing. Changes made to 
  7188. Config
  7189.  take effect only when 
  7190. Powerbase
  7191.  is next loaded. Each attribute is identified by a token word and there is a comment line describing each.  It is also possible to place a 
  7192. le in the computer
  7193. !Boot 
  7194. application, in the sub-directory pointed to by the system variable Choices$Write. Such a 
  7195. le will then be used in preference to the one in 
  7196. !Powerbase.Resources
  7197. . See 
  7198. 14.11.1
  7199.  for more details.
  7200. A database may also have its own 
  7201. Config
  7202.  file, placed inside the database directory, but some settings are only permitted in a 
  7203. master
  7204. Config
  7205.  file located either in 
  7206. Resources
  7207.  or in 
  7208. !Boot
  7209. . These are indicated by an asterisk in the following description. Each feature is identified by a token which is followed by either a numeric or string parameter and the order in which entries appear in the file is not important. Lines beginning with 
  7210.  are comments. 
  7211. Fields 
  7212. Maximum number
  7213.  of fields per record (default = 100, maximum = 127)
  7214. Keys 
  7215. Maximum number
  7216.  of subsidiary indexes (default = 10)
  7217. Tabs 
  7218. Maximum number
  7219.  of validation tables (default = 10)
  7220. Cols 
  7221. Maximum number
  7222.  of columns in a validation table (default = 20)
  7223. MaxLibs 
  7224. Maximum number
  7225.  of customisation libraries (see 
  7226. Ch.15) 
  7227. (default=10)
  7228. CustDir
  7229.  Pathname of recommended directory for customised databases (default=
  7230. Default
  7231. , the directory containing 
  7232. Powerbase
  7233.  itself.)
  7234. Scrolls
  7235.  Maximum number
  7236.  of scrollable lists (default=5)
  7237. BTime
  7238.  Number of seconds for which start-up banner is displayed (default=2, maximum=5)
  7239. LeftOpen
  7240.  Left-opening iconbar submenu (default=NO. Most users hate it but it 
  7241. might
  7242.  be preferred if the 
  7243. Powerbase
  7244.  icon is near the right-hand end of the iconbar.)
  7245. BackGnd
  7246.  Background colour for record window. (default=1, which also allows a background texture to appear if configured under RISC OS 4. Other numbers in the range 0-15 produce non-textured backgrounds in the standard Wimp colours. The colour 
  7247.  be set for individual databases but then affects only the background colour of field descriptors 
  7248.  not very useful.)
  7249. CBsize
  7250.  Width and height of Check-box icons (default=48,48 in OS units. Check-box icons need to be slightly larger than their sprites so that a noticeable black border appears when they are ADJUST-selected for printing. The RISC OS 4 sprites are smaller than those used previously and a setting of 44,44 still shows an adequate border. If you want to group Check-boxes so that they actually touch when stacked vertically the height can be reduced still further so that the horizontal borders disappear altogether.)
  7251. Margins
  7252.  Right and bottom margins of record window (default=16,16 in OS units. The record window is sized in such a way as to accommodate the longest and lowest fields, and the margins set here are additional to that minimum.)
  7253. ScrollBars
  7254.  Whether or not scroll-bars are present on the record window (default=YES, but small windows which don
  7255. t need to be scrolled look tidier without them.)
  7256. ClearSel
  7257.  Clear print selection after creating report (default=NO)
  7258. AllSpaces
  7259.  Allow primary key to consist of spaces only (default=NO. A rare requirement requested by one particular user!)
  7260. Upper
  7261. Force password entry in Access window to uppercase (default=NO)
  7262. DirOpts
  7263. Display option for directories opened by buttons on the record window (default is -si, meaning 
  7264. small icons
  7265. . This may be changed to -li or -fi for large icons and full information respectively. The options -sn, -st, -sd, -ss, to sort by name, type, date and size  may also be added.)
  7266. ExtFiles
  7267. (default=NEW. 
  7268. Method used for storing Text, Sprite and Draw files which are linked to External fields. You should not change this setting.)
  7269. PathLen
  7270. Maximum pathlength for Remote filer objects (default=255; max. prior to RISC OS 4)
  7271. FontAdj
  7272. Adjust width of data fields to take account of desktop font (default=YES)
  7273. Multi
  7274. Continue to multi-task when printing lists, indexing etc. (default=NO)
  7275. Markpane
  7276. Attach pane for marking records for printing etc. to record window. (default=YES).
  7277. NameLen
  7278. Maximum filename length (default=10. If you regularly use something like 
  7279. LongFiles
  7280. , or if you have RISC OS 4 and an E+ formatted disc,
  7281.  you might want to increase this value but beware if you give someone one of your databases containing saved files with names longer than 10 characters!)
  7282. ButtonAtts
  7283. Attributes of Directory and Run file buttons when used on record window (see 
  7284. 4.2.11
  7285. ). (default=42, the width of the button in pixels. The sprite will be vertically, as well as horizontally, centred on the button unless you add L to the number. If you do so then the name of the attached file or directory will appear on the button underneath the sprite.  You will almost certainly need to make the button much wider to accommodate the name.)
  7286. DialDelay
  7287. Double-clicking with SELECT on a field containing a phone number whose tag or descriptor contains the string TEL (case insensitive) will attempt to produce 
  7288. dial-tones
  7289.  through the internal speaker. If you hold a telephone handset where it can 
  7290.  the tones the number will be dialled. This 
  7291. Config
  7292.  option allows you to specify the delay in second between the double-click and the tones. (Default=5)
  7293. TimeFirst
  7294. determines the interpretation of incomplete entries in Time fields (see 
  7295. 4.2.5
  7296. ) Default=H, which means first number entered is assumed to be Hours, next is Minutes and last is Seconds. S causes numbers to be interpreted in reverse order.
  7297. FullTime
  7298.  Either always display as hh:mm:ss (default=YES. Changing to NO allows mm:ss for times under 1 hour.)
  7299. Output
  7300.  What to do with output destined for the printer Default=1, send directly to the file called 
  7301. printer:
  7302. . 2 means send first to Wimp$Scrap then copy to printer: The latter may be needed to overcome problems with certain combinations of hardware and versions of 
  7303. !Printers.
  7304. Messages
  7305.  file
  7306. This text file in the 
  7307. Resources 
  7308. sub-directory contains all the error and warning messages used by 
  7309. Powerbase
  7310.  including those for Acorn
  7311. s interactive 
  7312.  application. The wording may be altered if you wish.  Many error messages contain the string 
  7313.  and possibly 
  7314.  and 
  7315. .  Data items are substituted for these when the message is printed so don
  7316. t omit them or alter their logical placement within the message.
  7317. 14.10 Giving a database a title screen
  7318. You might like the idea of having your database start up by displaying a picture and/or some fancy text as an introduction. You can do this by devising a suitable sprite and saving the sprite file inside the database directory under the name 
  7319. Title
  7320. . Only the name of the sprite 
  7321.  is important; the name of the sprite itself is immaterial and, if the file contains more than one sprite, the first will be used.
  7322. When the database is opened the sprite will cover the record window and is scaled to fit. The aspect ratio of the sprite is maintained, which means there will usually be strips of grey bordering the sprite, either at the sides or at top and bottom, since it is most unlikely that the record window
  7323. s aspect ratio will match that of the sprite. If you want to display text it needs to be part of the sprite. The easiest way  is to design your title screen in 
  7324.  then grab it as a sprite using 
  7325. Paint
  7326. snapshot
  7327.  facility.
  7328. As soon as you click on a tool-pane button, or anywhere on the title screen itself, the sprite vanishes. You can bring it back if you really want to by clicking ADJUST on the tool-pane
  7329.  button (not very intuitive but such a trivial feature hardly deserves a special button or menu entry to itself!). If you later decide to dispense with the title screen you should simply delete the Title file.
  7330. 14.11 Saving and re-loading choices
  7331. User-choices governing various aspects of 
  7332. Powerbase
  7333.  are saved in the following 
  7334. !PrintOpts  
  7335. Choices speci
  7336. cally concerned with text output, whether to a window, a text 
  7337. le or to the printer.
  7338. CSVoptions
  7339.   Choices determining the way data is exported as CSV and related 
  7340. les, and the interpretation of 
  7341. les imported into a database.
  7342. Preference
  7343.   General choices which might frequently need changing and therefor should be easily accessible.
  7344. BackupDir
  7345.   The pathname of the directory used by the 
  7346. Backup 
  7347. button, the number of backup generations saved and whether or not backup is automatic on closing a database.
  7348. FieldCols  
  7349. Colours used to identify key 
  7350. elds, table-validated 
  7351. elds and mandatory 
  7352. elds.
  7353. Fkeys
  7354.   Keystroke equivalents for the keypad/tool-pane buttons.
  7355. GridOpts  
  7356. Options for the grid used when laying out the record format.
  7357. Config
  7358.   Options which only need altering at rare intervals, if at all.
  7359. For all except 
  7360.  the choices are made via dedicated windows and provision for saving the 
  7361. les is present on those windows.
  7362. 14.11.1  Where are choices 
  7363. les saved?
  7364. Windows from which choices may be saved have a 
  7365. Save choices
  7366.  button and either two or three radio buttons to select the place where the choices 
  7367. le is saved. In all such cases one radio button is called 
  7368. in Powerbase
  7369. . If this is selected the choices will be saved in 
  7370. !Powerbase.Resources
  7371. . In a new copy of 
  7372. Powerbase
  7373.  the 
  7374. Resources
  7375.  directory contains 
  7376. of the eight 
  7377. les listed above 
  7378.  not even 
  7379. . The 
  7380. les are present in another directory, 
  7381. !Powerbase.
  7382. Initial
  7383.  from which they are copied to 
  7384. Resources 
  7385. when you run 
  7386. Powerbase
  7387.  for the 
  7388. rst time. However, each 
  7389. le is copied only if there is no 
  7390. le of the same name already present in 
  7391. Resources
  7392. . This system is used because users often update 
  7393. Powerbase
  7394.  by dropping a later version on top of an older one. If they have altered the choices 
  7395. les to suit their own requirements the altered 
  7396. les will not be overwritten by the ones from 
  7397. Initial
  7398. . It goes without saying that you should not alter any of the 
  7399. les in 
  7400. Initial
  7401.  and no means of doing so is provided from within 
  7402. Powerbase
  7403. .  One way of discarding an unwanted choices 
  7404. le is to delete it from 
  7405. Resources
  7406. . The next time you run 
  7407. Powerbase
  7408.  the missing 
  7409. le will be identi
  7410. ed and the 
  7411. factory default
  7412.  copied from 
  7413. Initial
  7414. All relevant windows except those for grid options and keystroke equivalents also have an 
  7415. in database
  7416.  radio button. This allows the choices 
  7417. le to be saved within the database directory (in the database
  7418. PrintRes
  7419.  directory in the case of print-options 
  7420. les). Such a choices 
  7421. le will be used only by the database to which it applies and will be used by that database in preference to any other such 
  7422. le. Since choices of keystrokes and grid options are unlikely to vary with the database in use, no provision is made for saving database-speci
  7423. Fkeys
  7424. GridOpts
  7425. All the choices windows have another radio button which is only selectable if you are using RISC OS 3.5 or later (it is shaded under RISC OS 3.1) and is of use especially to users of RISC OS 4.33, which supports individual users by providing a log-on screen into which a user name and optional password are entered. If that facility has been enabled there will be a private directory for each user in 
  7426. !Boot.Choices.Users
  7427.  and the system variable Choices$Write will point to the logged-on user
  7428. s directory. When 
  7429. Powerbase
  7430.  is run it creates a subdirectory inside the user directory and choices 
  7431. les will be saved there if the aforementioend radio button is selected. The radio button itself is labelled 
  7432. for <username>
  7433.  leaving no doubt that you are saving choices for your use alone. 
  7434. If your version of RISC OS doesn
  7435. t have support for individual users the radio button will be labelled either 
  7436. Single
  7437.  (meaning single user) or 
  7438. Choices
  7439.  depending on how Choices$Write is set by the boot sequence. This is still a useful place to save choices 
  7440. les, although all users of the computer will be using the same 
  7441. les. To view the directory pointed to by Choices$Write, press f12 to access the command line, type: 
  7442. Filer_OpenDir <Choices$Write>
  7443.  and press Return.
  7444. 14.11.2  Priority of choices
  7445. If we consider one of the choices 
  7446. les, 
  7447. Preference
  7448. , for example, you can see from the above that there could be as many as four copies to consider:
  7449. A database-speci
  7450. le stored inside the database application itself.
  7451. A user 
  7452. le in 
  7453. !Boot.Choices.Users.<Username>.Powerbase 
  7454. (or wherever Choices$Write is pointing).
  7455. Powerbase
  7456.  working default 
  7457. le in 
  7458. !Powerbase.Resources
  7459. factory default
  7460. !Powerbase.Initial
  7461. The last of the four may usually be ignored. The other three are used in order of preference, as listed above, when you open a database, i.e. 
  7462. Powerbase
  7463.  looks 
  7464. rst for a database-speci
  7465. le and loads it if present. If no such 
  7466. le is found it looks for a user 
  7467. le. Failing that, the 
  7468. le from 
  7469. Resources
  7470.  (whose presence is guaranteed) will be loaded. 
  7471. When the relevant choices windows are examined the window title indicates the source of the 
  7472. le currently being used.
  7473. 14.11.3  What does the Load default button do?
  7474. Simply clicking with SELECT or ADJUST reloads whichever 
  7475. le was originally loaded when the database was opened, as determined by the priority order described above. Thus, if there is a database-speci
  7476. le then that will be loaded, the next choice is a user 
  7477. le and the 
  7478. nal choice the one from 
  7479. Resources
  7480. There might be occasions when you wish to override this order. SHIFT-clicking will preferentially load your user 
  7481. le (if any), CTRL-click loads the 
  7482. le from 
  7483. Resources
  7484. . You can even load the 
  7485. le from 
  7486. Initial
  7487.  by ALT-clicking.
  7488. 14.11.4  Preserving your own choices when upgrading
  7489. It has already been mentioned that copying a newer 
  7490. Powerbase
  7491.  onto an older one will not overwrite 
  7492. les saved in 
  7493. !Powerbase.Resources. 
  7494. For RISC OS 3.1 users this is the only place (other than in an individual database) where such choices may be preserved. Users of RISC OS 3.5 or later are reommended not to use this method but to save the 
  7495. les to Choices$Write as described in 
  7496. 14.11.1
  7497.  They will then remain intact even if 
  7498. Powerbase
  7499.  is accidentally deleted.
  7500. L    - 7
  7501. 0(%    -
  7502. 0x\    -
  7503. d    -P@
  7504. C    - 7
  7505. 08J    -
  7506. Ch 15 Customising 
  7507. Powerbase
  7508.  This is the most technical chapter in the manual and can safely be ignored by anyone who wishes to use only the built-in features of 
  7509. Powerbase
  7510.  as described in previous chapters. If you have rather special requirements and if you have some experience of BASIC programming then read on! 
  7511. Powerbase 
  7512. has many powerful and useful features but, as with any software, some users will have special requirements which aren
  7513. t catered for. This is why many organisations produce their software in-house as the only way of ensuring that their specific needs are met. I first came across this situation in the F.E. college for which 
  7514. Powerbase 
  7515. was originally written and in which it was (and still is) used to maintain student records. I was asked if the program could be enabled to print students
  7516.  personal timetables and, since 
  7517. Powerbase 
  7518. was used by so many other people for diverse purposes, was unwilling to include code for this very specialised function in the main program. The solution developed at that time was to provide the special feature in a subsidiary program file which was loaded as a library and to give 
  7519. Powerbase 
  7520. hooks
  7521.  to enable it to recognise the library and create the controls which gave the user access to the extra facilities.
  7522. This method of adding features to Powerbase has never been fully documented until now but has been progressively refined to the point where it can be offered to users in general.
  7523. A demonstration
  7524. The directory 
  7525. Customise 
  7526. is provided for you to try out database customisation easily and painlessly. It doesn
  7527. t do anything which is actually useful but it does show how non-standard features can be added to either an individual database or even to all the databases you use.
  7528. Take a 
  7529. Powerbase 
  7530. database, any database as long as it makes use of the tool-pane, open its directory with Shift-double-click and copy 
  7531. Customise 
  7532. into it. Now run 
  7533. Powerbase 
  7534. and open the database in the usual way. Straight away you
  7535. ll notice something non-standard; a little window which appears for a second to tell you that the database is open. A corresponding message is displayed when you close the database. (You were warned not to expect the demo to do anything really useful!)
  7536. At the bottom of the tool-pane you will see three buttons which aren
  7537. t normally present. One is a blue, square button resembling a house window. Next to it is a pop-up menu button, which you will have often seen elsewhere. Beneath these is an action button bearing the legend 
  7538. Click Me!
  7539.  Who could resist such an invitation? What it does is display a plain-text copy of this documentation.
  7540. Click on the 
  7541. window
  7542.  button and (surprise, surprise) a window opens. You won
  7543. t have seen this window before because it forms no part of 
  7544. Powerbase 
  7545. even though it has been invoked from 
  7546. Powerbase
  7547. s tool-pane. Clicking the three buttons on the new window causes incrementing values to appear in the icons above them. (Decrementing values if you click with ADJUST instead of SELECT.)
  7548. Click the menu button and you
  7549. ll see choices which will clear the numbers in the icons on the special window. There
  7550. s an item 
  7551. Print 
  7552. which produces a report showing the values of the three counters and allows it to be saved as a text file in the usual way. A submenu contains a single entry which, when chosen, calls up a validation table you didn
  7553. t know you had.
  7554. How is it done?
  7555. If you look inside 
  7556. Customise 
  7557. you will see several objects. The 
  7558. Templates 
  7559. file producing the non-standard window is there, so is the validation table called up from the submenu. The text-file 
  7560. is the one displayed by the 
  7561. Click me!
  7562.  button. The thing which does most of the work, however, is the BASIC file called 
  7563. , all of whose FN/PROCs become accessible, when required, as if they were part of the 
  7564. !RunImage
  7565.  itself. It
  7566. s now time to load 
  7567. Demo 
  7568. into your favourite editor (Zap or StrongEd but not Edit, I hope!) and have a good look at it.
  7569. Note first of all the frequent occurrence of the string 
  7570.  in the names of variables, functions and procedures. When assigning names to FN/PROCs and to variables specific to the library it is important to avoid clashes with names which are used within 
  7571. Powerbase 
  7572. itself and also with names in other libraries. You may have as many databases as you like, each with its own customisation library tailored to add specific features to that database, but no two libraries may contain identically named functions or procedures. Having identically-named variables is likely to be less serious but should still be avoided. 
  7573. Achieving the necessary uniqueness in naming isn
  7574. t difficult if you start out with the 
  7575. Demo 
  7576. library and do the following:
  7577. Choose a suitable name for the BASIC library 
  7578. le and rename 
  7579. Demo 
  7580. to that name. The choice of name isn
  7581. t critical but do keep it to 10 or fewer characters 
  7582.  not everyone can use long 
  7583. lenames. Where a library provides facilities for one database exclusively it is good practice to use the database name (minus the initial 
  7584. ) for the library.
  7585. Globally replace all occurrences in the 
  7586. le of the string 
  7587.  with the same name as used in (a). By 
  7588.  we mean an 
  7589. exact
  7590.  match, including identical use of upper and lowercase letters.
  7591.  This will ensure that the following functions in particular are re-named in a fashion which 
  7592. Powerbase 
  7593. can recognise*:
  7594. FN_Demo_setup
  7595. FN_Demo_button
  7596. FN_Demo_select
  7597. FN_Demo_click
  7598. FN_Demo_press
  7599. FN_Demo_drop 
  7600. FN_Demo_function
  7601. These seven functions are called from 
  7602. Powerbase 
  7603. and must not have their names changed once you have made the changes described in (b) above. If you have made those changes, try out your database again. All the non-standard features should work exactly as before. If the database and 
  7604. Powerbase 
  7605. are in the same directory you will notice no difference whatsoever. If, however, they are in different directories you will, on opening the database, see a message recommending you to move it into the directory containing 
  7606. Powerbase
  7607. . The reason for this will be explained later. 
  7608. Note that although you should not use the same name for 
  7609. different 
  7610. libraries (you
  7611. re likely to get program crashes and strange error messages if you do) it is possible to use the 
  7612.  library in more than one database, which is useful where a library provides general facilities not geared to one speci
  7613. c database.
  7614. What happens when 
  7615. Powerbase 
  7616. is run?
  7617. All the objects in a designated directory are examined to see whether they are databases containing a 
  7618. Customise 
  7619. directory. If any such are found, the pathnames of the BASIC libraries they contain are placed in a string array which is then used with the OVERLAY command. When any function is called which is not found in the 
  7620. !RunImage
  7621.  each library is loaded in turn until the required function is found and executed. Since all the libraries use the same area of memory, only one being paged in at any given time, this system makes economical use of RAM. The memory area used must be large enough to accommodate the biggest library, which is why it is advisable to have all your customised databases in a single directory (the 
  7622. designated directory
  7623.  referred to at the beginning of the paragraph) so that the maximum size of library can be found before any database is opened. This directory is specified in 
  7624. !Powerbase.Resources.Config
  7625.   by means of the entry 
  7626. CustDir 
  7627. (see 
  7628. ). As supplied this entry has the value 
  7629. Default
  7630. , which means the same directory as that which contains 
  7631. Powerbase 
  7632. itself, but you may replace 
  7633. Default
  7634.  with the pathname of any directory you wish. Another relevant 
  7635. Config
  7636.  entry is 
  7637. MaxLibs
  7638. ; the maximum number of libraries which can be handled. The default setting is 10 but you may increase this if necessary.  You can obtain a list of the libraries recognised by choosing 
  7639. Utilities=>Libraries
  7640.  from the iconbar menu. Double-clicking on a line of the displayed list will open the relevant 
  7641. Customise 
  7642. directory.
  7643. What happens when a database is opened?
  7644. If the database has a 
  7645. Customise 
  7646. directory, 
  7647. Powerbase 
  7648. looks at the list of libraries which it knows about to see whether the database
  7649. s library is one of them. If not the new library is added to the list, allowing you to use the customised features of databases outside the directory specified by 
  7650. CustDir
  7651.  but, if the new library is larger than any of the known ones, some memory will be wasted. For this reason you will see a message advising you to move the database into the same directory as the others. The message only appears the first time you open the database during a given session. Once the correct library has been identified 
  7652. Powerbase 
  7653. calls the function 
  7654. FN_<name>_setup
  7655.  (where <name> is either the database name or 
  7656. ). This, the first function in the library, is only called once while the database remains open and does the following:
  7657. Create buttons on the tool-pane, keypad or record window. These may be the 
  7658. window
  7659.  and menu buttons already seen in the demo, action buttons like Click me! (which may be called anything and can be made to do just about anything), square option switches and groups of radio buttons.
  7660. DIMension global arrays for the library
  7661. s especial use.
  7662. Declare important variables which the library might require.
  7663. Load validation tables which haven
  7664. t been loaded by the opening of the database.
  7665. Anything else which is an essential, 
  7666. one-off
  7667. , task for the functioning of the library.
  7668. Creating buttons
  7669. As can be seen from 
  7670. DEF FN_<name>_setup
  7671. , the special buttons are created via a function 
  7672. FNadd_button
  7673. . This function is part of 
  7674. Powerbase 
  7675. itself and takes seven parameters, returning as its result the icon-number of the newly-created button:
  7676. button%=FNadd_button(wi%,S$,type$,grey%,x%,y%,W%)
  7677. The meaning of the parameters is as follows:
  7678. The handle of the window on which the button is to be created. This must be either 
  7679. mainW%
  7680.  (for the record window) or 
  7681. keypadW%
  7682.  (even if the tool-pane, rather than the keypad, is being used).
  7683. The text which is to appear on the button (if an action button) or adjoining it (if a radio or option button). It may also be used in menu and 
  7684. window
  7685.  buttons on the record screen (but not on the keypad/tool-pane) to supply a descriptor for the button.
  7686. type$
  7687. This may be 
  7688. window
  7689. option
  7690. radio
  7691. . Any other value is understood as an action button.
  7692. grey%
  7693. A boolean variable which determines whether the button is shaded (TRUE) or not (FALSE) on first appearance.
  7694. x%,y%
  7695. Co-ordinates specifying the position of a button on the record window. They refer to the lower left corner of the button icon, the origin being the upper left corner of the window. y%, therefore, is always negative. Buttons on the keypad/tool-pane are positioned by Powerbase and any values supplied by the user are ignored.
  7696. The width of the button icon in OS units. It does not apply to 
  7697. window
  7698.  or menu buttons on the keypad/tool-pane (these are always 44 OS units square) but is relevant for all other types. For action buttons it is the width of the button itself, for all others it is the width of the button plus accompanying text. A value of W%=0 causes Powerbase to set the button width for you. You should normally do this for buttons on the keypad/tool-pane. These should be 144 OS-units wide and you should adjust the text so that it can be displayed within this width using the current desktop font. Buttons on the record window may be wider than this and, if W%=0, Powerbase will increase the width to accommodate the text. You can override this action by supplying your own value to make the button either wider than the automatic setting or narrower than the normal minimum of 144 OS units. This is useful if you wish to standardise the width of a group of record window buttons.
  7699. What goes inside the IF...THEN structure?
  7700. It will be seen that most of the setting-up in 
  7701. FN_<name>_setup
  7702.  occurs in the body of the 
  7703. IF...THEN
  7704.  structure, i.e. in lines 22-31 incl. Anything which must/should be done only once during a given Powerbase session with a particular database goes in here. Obvious examples are the DIMensioning of a global arrays and the reading of window definitions from a 
  7705. Templates 
  7706. file. Don
  7707. t put calls to 
  7708. FNadd_button
  7709.  in here because the custom buttons are removed from the tool-pane when the database is closed and 
  7710. icons (including buttons) on the record window are created from scratch on the empty window on opening.
  7711. Detecting events
  7712. Section 
  7713.  listed seven functions within a customisation library which are called from the main 
  7714. Powerbase
  7715.  code. 
  7716. FN_<name>_setup
  7717.  has already been described. The others are called under the following circumstances:
  7718. FN_<name>_button(wi%,ic%,b%)
  7719. This is called whenever the user clicks on one of  the custom buttons. 
  7720.  contains the handle of the window which owns the button. This will either be 
  7721. mainW%
  7722.  (button on record window) or 
  7723. keypadW%
  7724.  (button on tool-pane or keypad).
  7725.  gives the state of the mouse buttons and the user can test the bits to see which button was pressed and whether double-clicked or not. 
  7726.  is the icon number of the button. and all such numbers will be known to the programmer because s/he will have set them up using 
  7727. FNadd_button.
  7728. There will usually be at least one CASE statement to determine which button was pressed and take the appropriate action, such as opening a menu or window.
  7729. FN_<name>select(menu%)
  7730. Called when the user chooses from a menu which is not recognised by 
  7731. Powerbase
  7732.  and must therefore be one created by the customisation library. 
  7733. menu%
  7734.  is the handle of the menu and the item chosen is present, in textual form, in 
  7735. choice$(1)
  7736. . If the choice was from a 1st-level submenu the submenu choice will be in 
  7737. choice$(2)
  7738.  and so on down to
  7739.  choice$(4)
  7740. FN_<name>_click(wi%,ic%,b%)
  7741. Called when a button is clicked in a window which 
  7742. Powerbase
  7743.  doesn
  7744. t recognise and which must therefore be a window created within the customisation library.
  7745. FN_<name>_press(wi%,ic%)
  7746. Called when a keypress occurs and the window having the input focus is not known to 
  7747. Powerbase
  7748. . The key code is in 
  7749. key_pressed%
  7750. FN_<name>_drop(wi%,ic%)
  7751. Called when a file is dropped on a window not known to 
  7752. Powerbase
  7753. FN_<name>_function(func%)
  7754. Called when certain events apart from the above occur in 
  7755. Powerbase
  7756. . These events are only reported if the associated flag 
  7757. special%(n)
  7758.  has been previously set to 
  7759.  by the customisation library. There are eleven of these flags and not all have been assigned. Those which have been assigned are described below. There is no reason why the number shouldn
  7760. t be increased in future if users make use of customisation and report their requirements to Powerbase Support.
  7761. Database opening has been completed.
  7762. A record has just been read into the record window. The array Rf%() holds pointers to the icon text-buffers for the fields. A copy of the record is held in field$(). Scrollable lists and External fields have been read and all keys are now present in key$().
  7763. A record has been read into array F$(). This is the array used when printing reports and for some other operations, so that the displayed record is not affected. Only 
  7764. normal
  7765.  text and numeric fields are read: where field n is a scrollable list, external or button, F$(n)=
  7766. The displayed record has been written, including the writing of Scrollable lists and Externals and the insertion of keys into indexes.
  7767. The record held in F$() has been written back to 
  7768. Database.
  7769. tree-walk
  7770.  or file-scan of the current key has begun. The keys will be accessed in order until the end of the subfile is reached. If more than one subfile is involved the subfiles are  or scanned in sequence.
  7771. The aforementioned file-scan has finished.
  7772. A record has been matched to a search formula in the course of a file-scan
  7773. Database is about to close. The global variable 
  7774. Postpone% 
  7775. can be set to 
  7776. TRUE 
  7777. if you want to put off closing.
  7778. * Throughout this chapter Corpus Medium font is used to represent BASIC variables and functions.
  7779. Appendix A 
  7780. Powerbase 
  7781. as an 
  7782. Impulse 
  7783. server
  7784. The following is a description of the 
  7785. Impulse
  7786. methods
  7787.  understood by 
  7788. Powerbase
  7789. , given in the standard format recommended by Computer Concepts. Users wishing to write their own 
  7790. Impulse
  7791. tasks to communicate with 
  7792. Powerbase
  7793.  will need this information. They will also need details of the SWIs to which 
  7794. Impulse
  7795.  will respond, and this information is obtainable from Computer Concepts.    
  7796. {methods:
  7797. GetPathname 
  7798. Selection <string>
  7799. ParseQuery <string>
  7800. GetField <tag>
  7801. GetRecord
  7802. PutRecord
  7803. ExpandCode
  7804.  <string>
  7805. GetExpanded
  7806.  <string>
  7807. NextMatch
  7808. Description:
  7809. GetPathname
  7810.  specifies an 
  7811. object
  7812.  i.e. a 
  7813. Powerbase
  7814.  database. If 
  7815. Powerbase
  7816.  has the required database open it replies with the full pathname of the object, otherwise it returns an error message. Example of use:
  7817. :Powerbase !Elements GetPathname  (returns pathname of 
  7818. !Elements
  7819. R6 points to pathname when calling task is decoding reply.
  7820. Selection <string>
  7821.  tells 
  7822. Powerbase
  7823.  about a field, or group of fields, in which the caller is interested. The fields are specified as a list of 
  7824. , separated by any suitable character (e.g. 
  7825. ). The same separator must appear at the very end of the tag-list.  
  7826. Powerbase
  7827.  replies with the maximum data-length of the combined fields in the selection. Example of use:
  7828.   :Powerbase Selection NAME/SYM/Z/
  7829. R6 points to a string which gives data-length.
  7830. ParseQuery
  7831.  <string>
  7832.  informs 
  7833. Powerbase
  7834.  of the criteria to be used in selecting records to transmit to the caller.  The parameter is a standard 
  7835. Powerbase
  7836. search formula
  7837.  and 
  7838. Powerbase
  7839.  replies with the title which would normally appear at the head of one of its printed lists. Example of use:
  7840. :Powerbase ParseQuery GP=T
  7841. R6 points to returned title.
  7842. GetField
  7843.  <tag>
  7844.  requests from 
  7845. Powerbase
  7846.  the data in the specified field of the next record which matches the preceding ParseQuery command.  When 
  7847. Powerbase
  7848.  replies to the GetField command the calling task should respond with an 
  7849. Impulse_
  7850. FetchData, specifying the address and length of the buffer to be used, and then wait for an 
  7851. Impulse
  7852. _Receive event (reason code &204) before reading the buffer.  Example of use:
  7853. :Powerbase GetField NAME
  7854. GetRecord
  7855.  [<key>]
  7856.  (The square brackets signify that the key is optional: they are not part of the command.) Sent without a key it requests from 
  7857. Powerbase
  7858.  the next record which matches the preceding ParseQuery command. If the 
  7859. primary key
  7860.  of a record in the database is appended then 
  7861. Powerbase
  7862.  will return the record corresponding to that key. The key must be separated from the GetRecord by a space. The calling task must follow the procedure described above for GetField.  
  7863. Powerbase
  7864.  will transmit the fields specified in the Selection command, using the same separator as was used in that command. Receipt of data may be followed by another GetRecord command, returning the next matching record and so on, a zero-length response signifying that there are no more matching records. If using 
  7865.  to request specific records you should end by sending *** as a key to tell 
  7866. Powerbase
  7867.  that the dialogue is finished.  This command and the one below operate only on Subfile 0 of the 
  7868. Powerbase
  7869.  database. Example of use:
  7870. :Powerbase GetRecord ACTI
  7871. PutRecord
  7872.  informs 
  7873. Powerbase
  7874.  that the caller wishes to write a record to the current 
  7875. Powerbase
  7876.  database. It should be sent as message type &200. A Selection command should have been previously sent to tell 
  7877. Powerbase
  7878.  what fields to expect and what separator is to be used. 
  7879. Powerbase
  7880.  will then reply with a GetRecord command (reason code &201) which the caller should acknowledge with message type &202, specifying the maximum length of the data which will be sent. Wait for event &203 which is a request by 
  7881. Powerbase
  7882.  for the caller to transmit the data. The caller should then do so with 
  7883. Impulse
  7884. _TransmitData, specifying the buffer address and the length of data being sent. This may be immediately followed by  another PutRecord.
  7885. ExpandCode
  7886.  <string>
  7887.  requests the expanded form of a code used in a field linked to a 
  7888. validation table
  7889. . The parameter string consists of the code itself, then a space, then the name of the 
  7890. validation table
  7891.  with the number of the linked column appended. Example of use:
  7892. :Powerbase ExpandCode T Group0
  7893. GetExpanded
  7894.  <string>
  7895.  combines the functions of GetField and ExpandCode, i.e. it requests the expanded form of the contents of a specified field. The parameter is the tag of the field. It is not necessary to supply the name of the validation table or number of the linked column since 
  7896. Powerbase
  7897.  can determine these from the entry in the 
  7898.  file linking the field to the table. By default the second column of the table (i.e. column 1) is used to supply the expanded string, but this may be overridden by appending the relevant column number preceded by a comma as in the second example. Remember that the first column is numbered 0. Examples of use:
  7899. :Powerbase GetExpanded GP      :Powerbase GetExpanded GP,2    
  7900. NextMatch
  7901.  is designed to remove the restriction whereby only the data from a single record can be merged into a given document.  All it does is tell 
  7902. Powerbase
  7903.  to access the next record matching the 
  7904. search formula
  7905.  in the Merge window and interpret subsequent Merge commands by taking data from that record.
  7906. Appendix B 
  7907.  Keystroke equivalents
  7908. Only the function keys in the following list are re-assignable (see 
  7909. ); the Ctrl-letter keys are fixed. Users are also reminded that re-definition of F8, F9 and F10 will cause the Shifted variants to be assigned automatically (see 
  7910. Next record in subfile
  7911. Fast forward (default: 10 records)
  7912. Shift 
  7913. Final record in subfile
  7914. Previous record in subfile
  7915. Fast rewind (default: 10 records)
  7916. Shift
  7917. First record in subfile
  7918. Update
  7919. Select next subfile
  7920. Select previous subfile
  7921. Select next key
  7922. Shift
  7923. Select previous key
  7924. Shift
  7925. Shift record forward
  7926. Shift record backward
  7927. Delete 
  7928. record
  7929. Add new record
  7930. Copy displayed record
  7931. Shift
  7932. Search  
  7933. for key in current subfile
  7934. Search for key in all 
  7935. subfiles
  7936. Shift
  7937. filter
  7938. List 
  7939. validation table
  7940.  for field with caret
  7941. Turn validation ON/OFF
  7942. Shift
  7943. Play (rapid scan of records)
  7944. Stop (cancel above)
  7945. Shift
  7946. Show 
  7947. keypad
  7948. Print report
  7949. Print
  7950. Print 
  7951. displayed record
  7952. Shift
  7953. Print
  7954. Display Print Options window
  7955. Print
  7956. Set field where editing starts
  7957. Select all fields for printing
  7958. Balance current index & display brief results
  7959. As above, but display complete index tree
  7960. Shift  B
  7961. Copy field contents to 
  7962. clipboard
  7963. Enter current date 
  7964. Edit record template
  7965. Display list of fields, or of selected fields
  7966. Open 
  7967. Changes
  7968.  dialogue box for current field
  7969. Display 
  7970. Indexes
  7971.  directory
  7972. Open 
  7973. Index
  7974.  dialogue box for current field
  7975. Show structure of currently-selected key
  7976. Open 
  7977.  dialogue box for current field
  7978. Toggle mark-pane ON/OFF
  7979. Open Numeric field calculations window
  7980. Retrieve last search formula
  7981. Display 
  7982. PrintJobs
  7983.  directory
  7984. Display 
  7985. ValTables
  7986.  directory
  7987. Display 
  7988. PrintRes
  7989.  directory
  7990. Swap case of character to right of caret
  7991. Enter current time
  7992. Blank field
  7993. Paste field contents at caret
  7994. Restore keypad & record windows to initial state
  7995. Export CSV file
  7996. Display 
  7997. UserFuncs
  7998.  directory
  7999. Clear field selection
  8000. Add new row to scrollable list (when in last cell)
  8001. Shift
  8002. Return
  8003. As above, but from any cell & without scrolling
  8004. Insert
  8005. Delete 
  8006. blank
  8007.  row from scrollable list
  8008. Shift
  8009. Insert
  8010. Delete row with caret from scrollable list
  8011. Shift  Insert
  8012. Index
  8013. !BMARGIN 
  8014. !BODYFONT 
  8015. !CASE 
  8016. !CHANGE 
  8017. !CLEAR 
  8018. !COMMENT <string> 
  8019. !COPIES 
  8020. !CSV 
  8021. !DATA
  8022. !DATE 
  8023. !DELETE 
  8024. !DESTINATION 
  8025. !DUMP 
  8026. !ENDLOOP 
  8027. !EXCLUDE 
  8028. !EXPAND 
  8029. !FILTER 
  8030. !FILTEROPEN 
  8031. !FIND 
  8032. !FIRST 
  8033. !FIRSTPAGE 
  8034. !FONTSIZE 
  8035. !FORMAT 
  8036. !HEADER, !FOOTER 
  8037. !HEADERFONT 
  8038. !HEADINGS 
  8039. !IMPRESSION 
  8040. !INCLUDE 
  8041. !INDEX 
  8042. !INSERT 
  8043. !KEY 
  8044. !LABEL 
  8045. !LAST 
  8046. !LINESPACE 
  8047. !LMARGIN 
  8048. !LOOP 
  8049. !MAILMERGE 
  8050. !MESSAGE
  8051. !MOVE 
  8052. !NEXT 
  8053. !OBEY 
  8054. !ORIENTATION 
  8055. !PAGE 
  8056. !PAUSE 
  8057. !PMARGINS 
  8058. !PREVIOUS 
  8059. !PRINT 
  8060. !PRINTCOLUMNS 
  8061. !PRINTOPTS 
  8062. !QUERY 
  8063. !RMARGIN 
  8064. !SAVE 
  8065. !SCRIPT 
  8066. !SELECTION 
  8067. !SHRINK 
  8068. !SORT 
  8069. !SPACER 
  8070. !STARTAT 
  8071. !SUBFILES 
  8072. !TABLE 
  8073. !TEXTWIDTH 
  8074. !TITLE 
  8075. !TMARGIN 
  8076. !UPPER 
  8077. !WAIT 
  8078. @ in search formula to search all fields
  8079. @+Ctrl to set start field for editing
  8080. Absolute pathnames for Remote fields
  8081. Absolute pathnames, conversion to Relative
  8082. Access-control list 
  8083. Accumulating records in one subfile
  8084.  11, 15
  8085. Adding new records 
  8086. Add record
  8087.  button 
  8088. 11-12
  8089. Adjusting record format 
  8090. Allowed list in validation table
  8091. 45-48
  8092. Altering record format 
  8093. Altering existing records 
  8094. Analysing an index 
  8095. Analysing date field by months 
  8096. AND, use of in search formulae
  8097. Application shell, creating
  8098. Arbitrary selection of records, printing 
  8099. Arrow keys, action of 
  8100. Ascending sort
  8101. Auto-balancing indexes
  8102. Auto-opening user menus 
  8103. Average of column for numeric field
  8104. Background colour of record window 
  8105. Balancing indexes 
  8106. 68, 82
  8107. Banner, start-up, time displayed for
  8108. Binary Large OBjects (BLOBs)
  8109. Blanking  record on deletion 
  8110. Blue descriptor, meaning of 
  8111. Bookmarks, using
  8112. Bounding box of field, altering
  8113. Browsing 
  8114. Button fields 
  8115. 39, 84
  8116. Calculated fields 
  8117. 50-52, 54
  8118. Calculation formulae 
  8119. Calculations during global changes
  8120. Calculations involving dates 
  8121. Calculations involving times 
  8122. Calculations on a column of a report
  8123. Calculations, making retrospective 
  8124. Calling up records from the report window 
  8125. Case 
  8126. button on Query panel
  8127. 22, 31
  8128. Case-sensitive queries 
  8129. Change database size 
  8130. Changing key 
  8131. Changing many records at once 
  8132. Changing subfiles 
  8133. Check-boxes 
  8134. 20, 32, 35-36, 54, 61
  8135. Check-boxes, re-sizing
  8136. Clipboard, using 
  8137. 13, 94
  8138. Closing a database 
  8139. Colours, use in reports
  8140. Colours of key fields 
  8141. Colours window 
  8142. Columns in validation table, maximum 
  8143. Column headings in reports
  8144. Columns, printing Scrollable lists in 
  8145. Compacting sequence numbers
  8146. Comparators in search formulae 
  8147. 22, 26
  8148. Comparison by numeric value, forcing 
  8149. Composite fields 
  8150. 50-52
  8151. Computed fields 
  8152. 38, 50, 52, 81
  8153. Concatenation of fields
  8154. Conditional validation 
  8155. Config 
  8156. files 
  8157. Contiguous range of fields, selecting
  8158. Copy and paste (clipboard)
  8159. Copy to clipboard 
  8160. Copying an entire record 
  8161. Copying fields 
  8162. Count (number of values in column) 
  8163. Cross-referencing records 
  8164. CSV file, making database from
  8165. CSV files 
  8166. 16, 34, 48, 57-60, 63, 68, 71, 79, 84
  8167. CSV options 
  8168. 57-59, 61, 83
  8169. CSVoptions
  8170.  file
  8171. Customised databases, directory for
  8172. Data length 
  8173. 33, 66
  8174. Data Merge window 
  8175. Data overflow (CSV import) 
  8176. Data underflow (CSV import)
  8177. Data merging 
  8178. 63, 82
  8179. Database, constructing
  8180. Database 
  8181. file 
  8182. 8, 16, 36, 55, 66, 81
  8183. Database size, setting and changing 
  8184. 41, 68
  8185. Date-related fields
  8186. 29, 31, 34, 38-39
  8187. Default action on Return 
  8188. Default database, building 
  8189. 41, 32
  8190. Default print options file
  8191. Default query file
  8192. Default selection file
  8193. Defining the function keys 
  8194. Delete 
  8195. button 
  8196. Deleting records 
  8197. 12, 15, 93
  8198. Descending sort 
  8199. 18-19
  8200. Descriptor 
  8201. Descriptor, altering and re-positioning
  8202. Descriptor, changing colours of
  8203. Decsriptor, meaning of colours
  8204. 8, 55
  8205. Descriptor, in CSV header record
  8206. 57, 59
  8207. Descriptor, in report headings
  8208. 19-20, 75
  8209. Descriptor, omitting
  8210. Descriptor, positioning in record design
  8211. Design mode 
  8212. Dial-tones, generating
  8213. Dial-tones, delay before sounding 
  8214. Directory for customised databases
  8215. Directory 
  8216. button, displaying name with
  8217. 40, 85
  8218. Disabling features from password window 
  8219. Displaying linked table data 
  8220. Doubled comparator, effect of 
  8221. Draw files 
  8222. 16, 36
  8223. Duplicated primary keys, listing 
  8224. Duplicated primary keys, forbidding 
  8225. Duplicated primary keys, warning of
  8226. 71, 81
  8227. Editable fields, list of types
  8228. Editing mode 
  8229. Editing scrollable lists 
  8230. Emailing Powerbase Support 
  8231. Empty database, building
  8232. Ends 
  8233. button 
  8234. Evaluate
  8235.  button, calculations using
  8236. Exact match in validation table
  8237. Exit 
  8238. button
  8239. Expanding validation table entries
  8240. 29, 49
  8241. Expanding headers 
  8242. Export 
  8243. Export subset 
  8244. Export the linked file 
  8245. External 
  8246. External fields 
  8247. 13, 16, 36, 60-61, 81
  8248. External fields, list of types
  8249. Fast forward interval 
  8250. Fast forward/rewind button 
  8251. Field 
  8252. Field, classes of
  8253. Field creation 
  8254. Field definition window 
  8255. 32-34
  8256. Field menu button 
  8257. Field, selection for printing
  8258. Field to be substituted on labels
  8259. Field-concatenation in reports
  8260. Field-separators in reports
  8261. Fields, adding to record format
  8262. 66, 67
  8263. Fields, maximum number 
  8264. Fields, menu of selected 
  8265. Fields, printable
  8266. 20, 21
  8267. Filenames in script commands 
  8268. Filter, use of 
  8269. 10-11, 94
  8270. Fixed data on labels
  8271. Flashing primary key field, meaning of
  8272. Following moved record to new subfile 
  8273. Font, desktop, allowing for 
  8274. Footers in reports 
  8275. 29, 54
  8276. Form 
  8277. file 
  8278. Frames in record design 
  8279. Function keys 
  8280. 9, 71, 84
  8281. Functioning database from CSV file
  8282. General menu button 
  8283. Global changes 
  8284. 14-15
  8285. Global clipboard, use of 
  8286. Grid for record design 
  8287. Header 
  8288. 29, 59, 75
  8289. Header record in CSV file
  8290. 57, 59, 61
  8291. Headers/footers in reports 
  8292. Headings 
  8293. Help application (Acorn)
  8294. Help window 
  8295. Helpreader text 
  8296. Hidden fields
  8297. Hiding sensitive data 
  8298. Horizontal format (reports)
  8299. 18, 19, 29, 74-75
  8300. Hyphen, use of in search formulae 
  8301. I.D.s and passwords 
  8302. Iconbar menu 
  8303. 71, 84
  8304. Importing data from CSV files 
  8305. Importing data from plain text files 
  8306. Impression, 
  8307. merging data with
  8308. 63-65
  8309. Impulse 
  8310. commands
  8311. 63, 65, 82, 92-93
  8312. Inclusive search 
  8313. Increment 
  8314. button
  8315. Index 
  8316. 8-10, 44, 55
  8317. Index, analysing
  8318. Index, balancing
  8319. Index, named in report header
  8320. Indexes, saving 
  8321. 12, 56, 82
  8322. Indexes 
  8323. directory 
  8324. 32, 55
  8325. Indexing a field 
  8326. 55, 76
  8327. Input from script files 
  8328. Inserting merge commands 
  8329. Internet (field type)
  8330. Keeping descriptor with data during design
  8331. Key, changing to another
  8332. Key, deciding structure of
  8333. 41-44
  8334. Key field 
  8335. 8, 10, 41, 44
  8336. Key fields, colouring of
  8337. Key, searching for record by
  8338. Key structure 
  8339. 10, 41-43, 55, 66
  8340. Key Structure window 
  8341. Key-change button 
  8342. Keypad 
  8343. 9, 39, 71, 
  8344. , 83, 94
  8345. Keys, distribution in index tree 
  8346. Keys, repeated primary
  8347. Keys, maximum number 
  8348. Keystroke equivalents 
  8349. Keystroke equivalents, defning 
  8350. 83-84
  8351. Keystroke equivalents, list of
  8352. 93-94
  8353. Keystroke menu 
  8354. Label format
  8355. Last altered 
  8356. Launch new copy 
  8357. Line terminator 
  8358. Line-spacing in reports
  8359. Linking files to the fields 
  8360. Linking tables to fields 
  8361. List of available comparators 
  8362. Load defaults 
  8363. Loading Powerbase 
  8364. Loading validation tables 
  8365. Locking fields against alteration
  8366. Log changes 
  8367. Log file 
  8368. Logging, types of events reported
  8369. Looping in script files
  8370. 76-77
  8371. Logo fields
  8372. 36, 38-39
  8373. Mail-Merging 
  8374. 63, 65
  8375. Main menu 
  8376. 71, 84
  8377. Manager access rights 
  8378. Manager password 
  8379. Mandatory fields 
  8380. Mandatory fields (see 4.2.14). 
  8381. Margins 
  8382. Marking records 
  8383. Markpane 
  8384. Match window 
  8385. 21, 26, 39, 73
  8386. Matches found, number of 
  8387. Matches in the subfile 
  8388. Maximum value allowed in numeric field
  8389. Maximum value in column of report
  8390. Maximum number of customisation libs. 
  8391. Menu buttons 
  8392. Menus 
  8393. subdirectory 
  8394. 32, 40
  8395. Merge commands, inserting in document 
  8396. Merging databases 
  8397. Messages 
  8398. file 
  8399. Minimum value allowed in numeric field
  8400. Minimum value in column of report
  8401. Month 
  8402. More than one field in a key 
  8403. More than one subfile 
  8404. Move record button 
  8405. Move records 
  8406. Multi-tasking within 
  8407. Powerbase
  8408. Multi-criterion searches 
  8409. Multiple subfiles, use of 
  8410. Naming subfiles 
  8411. New record format 
  8412. NoCanDo
  8413.  file, purpose of
  8414. NOT, use of in search formulae
  8415. Number of lines on the label 
  8416. Numeric 
  8417. 29, 34
  8418. Numeric field 
  8419. 15, 43, 45, 50-51, 54
  8420. Numeric min 
  8421. Numeric value of the field 
  8422. button 
  8423. Only if targetted in query 
  8424. Opening a database 
  8425. Options, CSV
  8426. OR, use of in search formulae
  8427. Order of records in database
  8428. Order of selection of fields
  8429. Output destination 
  8430. 18, 27
  8431. Ovation
  8432. , merging data with 
  8433. Ovation Pro
  8434. , merging data with
  8435. 63-65
  8436. Page length in reports
  8437. Page numbers in reports 
  8438. Part sheet of labels, using up 
  8439. Password 
  8440. 7, 66, 70-71
  8441. Password protection 
  8442. Password window 
  8443. Paste from clipboard 
  8444. PathLen 
  8445. Pathnames: see Absolute and Relative
  8446. Pathnames for Remote fields
  8447. 37-38
  8448. Pathnames, interconverting
  8449. Personal passwords and I.D.s
  8450. Picture fields 
  8451. 16, 36
  8452. Play 
  8453. button
  8454. Pop-up menu 
  8455. Powerbase Support, contacting
  8456. Preferences 
  8457. 47, 56, 68, 71, 80-81
  8458. Preferences window 
  8459. 34-35
  8460. Primary key 
  8461. Primary key, altering
  8462. Primary key, colour of data field
  8463. Primary key, defining
  8464. Primary key, examples of
  8465. 41-43
  8466. Primary key, inclusion in CSV file
  8467. Primary key index 
  8468. PrimaryKey
  8469.  file
  8470. 41, 55
  8471. Primary key, printing on address labels
  8472. Primary key, repeated, forbidding
  8473. Print 
  8474. button
  8475. Printable fields, list of
  8476. 20-21
  8477. Print formats 
  8478. Print Options 
  8479. 18, 28, 31, 49, 57, 59, 74
  8480. Print options window, opening
  8481. Print options files 
  8482. Print Resources 
  8483. Print selections 
  8484. Printer destination 
  8485. Printer setup options 
  8486. Printing, selecting fields for
  8487. Printing speed 
  8488. PrintJobs 
  8489. directory
  8490. 18-19, 32, 38, 48, 58, 60, 74, 81
  8491. PrintRes
  8492.  directory
  8493. 21, 25, 30, 32, 73-74, 83
  8494. UserFuncs 
  8495. directory
  8496. 32, 52
  8497. Query by example 
  8498. 21, 25, 82
  8499. Query by example, limitations of
  8500. Query files 
  8501. Query method (QSF, QBE), changing
  8502. Query panel 
  8503. 22, 26-27, 31, 58, 73, 79
  8504. Querying scrollable lists 
  8505. Quit 
  8506. button
  8507. Quitting Powerbase 
  8508. Quotation marks in CSV files
  8509. RAM disc (footnote)
  8510. Re-loading last saved report 
  8511. Re-ordering fields during record design
  8512. Read password 
  8513. Read/write password
  8514. Rebuilding a  database 
  8515. Recalculating existing records 
  8516. Recalculating on opening 
  8517. Record 
  8518. 8, 59
  8519. Record edits as CSV file 
  8520. Record layout 
  8521. Record number 
  8522. 8, 38
  8523. Record window 
  8524. 8, 10-11, 16, 33-34, 36, 39, 44, 48, 60-61, 64, 82
  8525. Record window. 
  8526. Record-terminators 
  8527. Red descriptor, meaning of
  8528. Relative pathnames for Remote fields
  8529. Relative pathnames, conversion to Absolute
  8530. Reloading saved reports 
  8531. Remember place in subfile 
  8532. Remote fields 
  8533. 16, 36
  8534. Removing filed linked to External fields 
  8535. Removing field from record layout 
  8536. Renaming a database 
  8537. Renumbering fields during record design 
  8538. Replace on entry
  8539. 46-47
  8540. Report printing 
  8541. 18, 71
  8542. Requesting input to script files
  8543. Restore will put a sorted report 
  8544. Retaining subfile structure (new prim.key)
  8545. Right-justification, of numeric fields 
  8546. Right-justification, of numbers in keys
  8547. Rotate 
  8548. buttons 
  8549. Run file
  8550.  button, displaying name with
  8551. 40, 85
  8552. Same tag, where permitted 
  8553. Save box 
  8554. 18-19, 32, 48
  8555. Save indexes 
  8556. Saving marked record status 
  8557. Script file, automatic execution of
  8558. Script file, linking to Run file button 
  8559. Script file, loops in
  8560. 76-77
  8561. Script file, requesting user input to
  8562. Script files 
  8563. 65, 73
  8564. Script language 
  8565. Scrollable list 
  8566. Scrollable list, file dropped on
  8567. 17, 58
  8568. Scrollable list, saving as CSV file
  8569. Scrollable list, saving as text file
  8570. Scrollable lists 
  8571. 20, 35
  8572. Scrollable lists and CSV files 
  8573. Scroll-bars, removing from record window 
  8574. Scrollable lists, maximum number 
  8575. Search 
  8576. button 
  8577. Search element 
  8578. 22, 26
  8579. Search formula 
  8580. 21-22
  8581. Search formula, exporting subsets using
  8582. Search formula, from Help window
  8583. 26-27
  8584. Search formula, construction of
  8585. 21-25
  8586. Search formula in CSVexport
  8587. Search formula in Filter window
  8588. Search formula in Global changes
  8589. Search formula in mail-merging
  8590. Search formula in report header
  8591. Search formula in Script commands
  8592. 73-74, 76
  8593. Search formula, saving as 
  8594. Query 
  8595. Search window 
  8596. 10-11
  8597. Searching 
  8598. 10-11, 55
  8599. Searching all six subfiles
  8600. Searching by filter 
  8601. Selection, clearing after use
  8602. Selections, fields 
  8603. Selection files 
  8604. Self-calculating fields
  8605. Sep and Row end 
  8606. Separator, of fields in CSV files
  8607. 57, 59
  8608. Separators in date and time fields 
  8609. Sequence number fields 
  8610. 38, 59
  8611. Sequence numbers, compacting 
  8612. Setting passwords 
  8613. Shifting records betweeen subfiles 
  8614. Shrink line
  8615.  button
  8616. Shrink list
  8617.  button
  8618. 18, 29
  8619. Single line format for scrollable lists
  8620. Single-step
  8621.  button 
  8622. Sort, ascending and descending 
  8623. 18, 19
  8624. Sorting a report 
  8625. 18, 19
  8626. Sorting a validation table
  8627. Sorting with a subsidiary index
  8628. Spacer in reports
  8629. 19-20, 29
  8630. Sprite files 
  8631. 16, 36
  8632. Stamp fields
  8633. Stamp fields, list of types
  8634. Standard deviation for column of numbers 
  8635. Start editing at (field)
  8636. Start editing at 
  8637. Stop button 
  8638. Strip leading spaces 
  8639. Strip spaces 
  8640. Strip trailing spaces 
  8641. Subfile 
  8642. le, disabling
  8643. le, enabling
  8644. le, naming
  8645. Subfile number in a report 
  8646. Subfile-change button 
  8647. Subfiles 
  8648. 10-11, 51, 66-67, 71, 94
  8649. les, rotation of
  8650. Subset databases 
  8651. Subsidiary indexes 
  8652. 10, 31
  8653. Subsidiary key 
  8654. Subsidiary keys 
  8655. Sum of numbers in column of report
  8656. Swapping fields during record design
  8657. Table, validation, creating
  8658. 46-47
  8659. Table 
  8660. button 
  8661. Table format (reports)
  8662. 20, 29, 75
  8663. Tabs Maximum number 
  8664. Tag, altering and re-positioning
  8665. Tag, importance of
  8666. 33, 34
  8667. Tag, importance of when reformatting
  8668. Tag, in CSV header record
  8669. 57, 59
  8670. Tag, in Key definition window
  8671. Tag, in report headings
  8672. 19-20, 75
  8673. Tag, in search formulae
  8674. 22-23
  8675. Tag, insertion into query using Ctrl key
  8676. Tag list in search formula
  8677. 22-23
  8678. Tag, selection using Help window
  8679. Tag, use in name of saved files
  8680. 13, 62
  8681. Tag, when it may be omitted 
  8682. Tag, when it may be duplicated
  8683. Target list in search formulae
  8684. Terminator 
  8685. 57, 59
  8686. Text fields
  8687. Text block fields
  8688. 16, 20, 29, 33, 36, 60
  8689. Text button 
  8690. Text file, as output destination 
  8691. Text files 
  8692. 16, 36
  8693. Text width 
  8694. 20, 29
  8695. Three-state check-boxes 
  8696. 21, 35
  8697. Time entry, how interpreted
  8698. Time fields 
  8699. 34-35, 38, 51-52
  8700. Title (optional) on reports
  8701. Title-bar, information displayed in
  8702. TooBig
  8703.  file, purpose of
  8704. Tool-pane 
  8705. 9, 39, 46, 48, 55, 71, 80
  8706. Tool-pane or keypad?
  8707. TSV files
  8708. Two-state check-boxes 
  8709. Undoing changes
  8710. 12, 15, 48
  8711. Unrestricted (field-type)
  8712. Update 
  8713. button 
  8714. 12, 46, 48, 56, 82, 93
  8715. Upper case 
  8716. 29, 34, 85
  8717. User function 
  8718. User functions 
  8719. Using a template 
  8720. Using CSV files to modify existing records 
  8721. Using more than one subfile 
  8722. UsrSprites
  8723.  file
  8724. Validation 
  8725. 45-48
  8726. Validation, conditional
  8727. Validation, turning on and off
  8728. 12, 45, 81
  8729. Validation string of field icons
  8730. Validation table 
  8731. 11-13, 45
  8732. Validation table, colour of field linked to
  8733. Validation table, creating
  8734. Validation table, displaying
  8735. Validation table, expanding report headers
  8736. Validation table, exporting as CSV file
  8737. Validation table, including data in reports 
  8738. Validation table, linking to field
  8739. Validation table, loading
  8740. Validation table, modifying
  8741. Validation table, saving
  8742. Validation table, sorting
  8743. Validation tables and Calculated fields
  8744. ValStrings 
  8745. ValTables 
  8746. directory
  8747. 32, 48, 94
  8748. Vertical format (reports)
  8749. 20, 29, 74
  8750. Warn of duplicates 
  8751. Warn of external deletion 
  8752. Website for Powerbase Support 
  8753. White space
  8754. ,  removal from report
  8755. 18, 28, 29
  8756. Wild-card characters, defining 
  8757. Wild cards in search and replace
  8758. Wild cards in search formulae
  8759. Window destination 
  8760. Wiping a scrollable list 
  8761. Wrap-around 
  8762. Year (field-type)
  8763. Yellow background to field, meaning of
  8764. Yes/No/Maybe field type
  8765. tion t
  8766. eP,    7
  8767. eXy    7
  8768. e87    7
  8769. e`N    7
  8770. e0B    7
  8771. 1_Plain
  8772. ABC45XYZ
  8773. 57XYZ
  8774. LBING
  8775. ytown
  8776. EETSYM5
  8777. bloggs
  8778. BRITCERCAR
  8779. COMPARATOR
  8780. CONFUSER
  8781. DAT1-DAT2
  8782. david
  8783. d-mm-yy
  8784. irOpts
  8785. EasyV
  8786. email
  8787. FastSp
  8788. dsData
  8789. GALBERT
  8790. ydn's
  8791. HAYDSYM
  8792. HERRALBE
  8793. Impul
  8794. ystroke    s
  8795. MAHLER
  8796. SONEAR
  8797. MOZAPIACON23
  8798. MyPhotos
  8799. OBjects
  8800. outpu
  8801. ICLIB
  8802. tJobs
  8803. ROTOACTINIUM
  8804. tmost
  8805. RINER
  8806. SMITJ
  8807. kPlug
  8808. subdi
  8809. rget1
  8810. rflow
  8811. idgets
  8812. index
  8813. contents
  8814. * DDF: Document Description Format; the means by which styles and effects are encoded within an 
  8815. Impression
  8816.  document.
  8817. ArcDraw     
  8818. screen
  8819. wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
  8820. @DDDDDDDDDDDDDDDD
  8821. DDDDDDDDDDDDDDDD
  8822. DDDDDDDDDDDDDDDDD
  8823. @DDDDDDDDDDDDDDDD
  8824. wwwwwwwwwwwwwwwww
  8825. @DDDDDDDDDDDDDDDD
  8826. DDDDDDDDDDDDDDDDD
  8827. wwwwwwwwwwwwwwwww'q
  8828. qwwwww
  8829. qwwwww
  8830. qwwwww
  8831. qwwwww
  8832. qwwwww
  8833. qwwwww
  8834. qwwwww
  8835. qwwwww
  8836. qwwwww
  8837. qwwwww
  8838. qwwwww
  8839. qwwwww
  8840. qwwwww
  8841. qwwwww
  8842. @DDDDDDDDDDDDDDDD
  8843. DDDDDDDDDDDDDDDD
  8844. DDDDDDDDDDDDDDDDD
  8845. @DDDDDDDDDDDDDDDD
  8846. qwwww
  8847. qwwq'07
  8848. @DDDDDDDDDDDDDDDD!
  8849. DDDDDDDDDDDDDDDD
  8850. DDDDDDDDDDDDDDDDD
  8851. @DDDDDDDDDDDDDDDD
  8852. +"""""""""
  8853. +"""""""""
  8854. +w"ww'rr"'
  8855. +"""""""""
  8856. +'w'rww''"
  8857. +"""""""""
  8858. +w'r"w'rw'
  8859. +"""""""""
  8860. +"""""""""
  8861. @DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
  8862. DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
  8863. ww"ww
  8864. q"""""
  8865. '33333r
  8866. wwwwwww
  8867. q"""""
  8868. qBB"$$
  8869. """"""""""
  8870. qBB"$$
  8871. """"""""""
  8872. qBB"$$
  8873. r'rww"''r"
  8874. qBB"$$
  8875. """"""""""
  8876. qBB"$$
  8877. rrw"wwwr""
  8878. qBB"$$
  8879. """"""""""
  8880. qBB"$$
  8881. rw"'rw"ww"
  8882. qBB"$$
  8883. """"""""""
  8884. qBB"$$
  8885. """"""""""
  8886. qBB"$$
  8887. q"""""
  8888. qwwwww
  8889. @DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
  8890. DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
  8891. @DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
  8892. DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
  8893. wwwww
  8894. qwwwwwwwwwww
  8895. @DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
  8896. DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
  8897. ww73sww
  8898. qww33ww
  8899. pwwwp
  8900. wwpwpp
  8901. qppppw
  8902. wwwwwww
  8903. qwwwwwww
  8904. qwwwwww
  8905. wwwwwww
  8906. @DDDDDDDDDDDDDDDD
  8907. DDDDDDDDDDDDDDDD
  8908. DDDDDDDDDDDDDDDDD
  8909. @DDDDDDDDDDDDDDDD
  8910. twG!Wwg!'
  8911. s$'!G
  8912. A&'1&
  8913. BUg!7
  8914. 1''Qwww
  8915. 1g3d!7
  8916. 1''Q633
  8917. A&2w"w#t#'
  8918. vws&6vG!&
  8919. @DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
  8920. DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
  8921. 1'ru&'ruw
  8922. r7"'r
  8923. @DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
  8924. DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
  8925. !ww#'
  8926. r"WwW
  8927. A'!Tu
  8928. !7s6C
  8929. 1&'!7!7
  8930. d"s'r&b%'
  8931. V"w"w#t
  8932. aw7g!vW!&
  8933. swd"GvG
  8934. @DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
  8935. DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
  8936. a%WwW
  8937. 1ww7Aww
  8938. s%!v"w#t
  8939. a&b7d"s'a
  8940. 1vw&!GvG
  8941. !vW6aw7gAg
  8942. @DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
  8943. DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
  8944. vwwWr"'1
  8945. 1!'a#
  8946. vg2ww
  8947. vww$r"'a
  8948. uww7!'
  8949. e33#!'
  8950. b"&Ag"vW
  8951. BDDDDDDDDD
  8952. !TUUUUUUUUU
  8953. qwwwwwwwwwwwwwwwww
  8954. wwwwwwwwwwwwwwwww
  8955. q""""""""""""""""r
  8956. '""""""""""""""""
  8957. q""""""""""""""""r
  8958. '""""""""""""""""
  8959. q""""""""""""""""r
  8960. '""""""""""""""""
  8961. 'q""""""""""""""""r
  8962. '""""""""""""""""
  8963. q""""""""""""""""r
  8964. '""""""""""""""""
  8965. q""""""""""""""""r
  8966. '""""""""""""""""
  8967. q""""""""""""""""r
  8968. '""""""""""""""""
  8969. r""""""""""""""""r
  8970. '""""""""""""""""
  8971. q""""""""""""""""r
  8972. '""""""""""""""""
  8973. q""""""""""""""""r
  8974. '""""""""""""""""
  8975. q""""""""""""""""r
  8976. '""""""""""""""""
  8977. q""""""""""""""""r
  8978. '""""""""""""""""
  8979. r""""""""""""""""r
  8980. '""""""""""""""""
  8981. q""""""""""""""""r
  8982. '""""""""""""""""
  8983. q""""""""""""""""r
  8984. '""""""""""""""""
  8985. r""""""""""""""""r
  8986. '""""""""""""""""
  8987. q""""""""""""""""r
  8988. '""""""""""""""""
  8989. qwwwwwwwwwwwwwwwww
  8990. wwwwwwwwwwwwwwwww
  8991. qwwwwwwwwwwwwwwwww
  8992. wwwwwwwwwwwwwwwww
  8993. q""""""""""""""""r
  8994. '""""""""""""""""
  8995. r""""""""""""""""r
  8996. '""""""""""""""""
  8997. q""""""""""""""""r
  8998. '""""""""""""""""
  8999. q""""""""""""""""r
  9000. '""""""""""""""""
  9001. q""""""""""""""""r
  9002. '""""""""""""""""
  9003. q""""""""""""""""r
  9004. '""""""""""""""""
  9005. 'q""""""""""""""""r
  9006. '""""""""""""""""
  9007. q""""""""""""""""r
  9008. '""""""""""""""""
  9009. q""""""""""""""""r
  9010. '""""""""""""""""
  9011. q""""""""""""""""r
  9012. '""""""""""""""""
  9013. r""""""""""""""""r
  9014. '""""""""""""""""
  9015. 'q""""""""""""""""r
  9016. '""""""""""""""""
  9017. q""""""""""""""""r
  9018. '""""""""""""""""
  9019. q""""""""""""""""r
  9020. '""""""""""""""""
  9021. 'q""""""""""""""""r
  9022. '""""""""""""""""
  9023. 'q""""""""""""""""r
  9024. '""""""""""""""""
  9025. q""""""""""""""""r
  9026. '""""""""""""""""
  9027. qwwwwwwwwwwwwwwwww
  9028. wwwwwwwwwwwwwwwww
  9029. wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
  9030. ArcDraw     
  9031. screen
  9032. wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
  9033. !""""""2u
  9034. """"""
  9035. " """"  "
  9036. """"""
  9037. """""""S
  9038. !""""""2u
  9039. !!!""
  9040. " ! ""
  9041. !""rwwg
  9042. !!"!""
  9043. !!!""
  9044. " ! ""
  9045. !""" "
  9046. !!"!""
  9047. """""""S
  9048. !""""
  9049. """"!
  9050. "!"""!!"
  9051. """"""
  9052. "r62t
  9053. !""""
  9054. """"!
  9055. "!"""!!"
  9056. """"""
  9057. """""""S
  9058. """""""  
  9059. "!  """
  9060. !!!r&!R7!B$!"
  9061. ""3s34" C$"
  9062. "!  """
  9063. !!!  !""!!
  9064. """""2u
  9065. """""""S
  9066. !!!" "
  9067. """""""
  9068. "r&"B7Aww$W
  9069. t#tw72gwsvw&Pww
  9070. vw&Bww#
  9071. """""""
  9072. """""
  9073. """""""S
  9074. !""""!""
  9075. """!""
  9076. c's&R7f2v$u2W!e2w4s7BWt$R'BG"Gs
  9077. Q&!T"
  9078. """!""
  9079. "UUUU%"S
  9080. " ""!""!""
  9081. "!" !""!
  9082. !!"!"" rwww
  9083. t#"GtBg
  9084. s4G!s
  9085. uC"B'B7!"t
  9086. "!" !""!
  9087. !!"!"" "!""
  9088. !""""
  9089. "%"""
  9090. A4"BC
  9091. !""5S!"2u
  9092. !""""" ""!
  9093. ""rFD
  9094. "gsSF6Gbwww47
  9095. s$"t3ev'"vg
  9096. vwwG!""""" ""!
  9097. """""
  9098. "" """"
  9099. "%"""
  9100. 0%"2u
  9101. """"""
  9102. !"""""!
  9103. """ !!!"r&
  9104. v""gbe5W7aGDD37"s
  9105. "ttFT'"BeGvDD4!"""""!
  9106. """ !!!"!!
  9107. """"""!""""""
  9108. A$%"!C
  9109. """""!""!""!
  9110. "!!!!
  9111. """""!"""
  9112. 2Gbw$v&A'"S27"s%!ff!B'A
  9113. !ft"2%"!!!!
  9114. """""!"""
  9115. """"""""1u
  9116. """""""S
  9117. """"!"!
  9118. "!!"r
  9119. r7c'Ag"v
  9120. "g3g27"sGSGu3t7BG2Gr6s&"T
  9121. "!!""
  9122. """2u
  9123. """""""S
  9124. """""!"""!"
  9125. "!!""
  9126. ""b%"!!1vg
  9127. sw&26"ctw%bwGw
  9128. uw%2wg"
  9129. "!!""
  9130. """!"!!
  9131. """""1u
  9132. """""""S
  9133. "!!"%
  9134. ""!"!!!
  9135. !!!"!
  9136. !!""!!""
  9137. """"!
  9138. ""!"!"!
  9139. "!!"!""
  9140. !!""!!""
  9141. """"!
  9142. ""!"!1u
  9143. """""""S
  9144. """"%!!C
  9145. !""""""2u
  9146. "!!"!!
  9147. !""""!
  9148. !!!"""""
  9149. "!!"!!
  9150. !""""!
  9151. !!!"""""
  9152. """""""S
  9153. 1UUUU%""C
  9154. 23333333u 33333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333u 3333333S
  9155. 23333333C
  9156. 'TUUUUUUUuBUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUuBUUUUUUUU'DDDDDDDDD
  9157. wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
  9158. qwwwwwwwwwwwwwwwwww!
  9159. DDDDDDDDDDDDDDDDDDDD
  9160. @DDDDDDDDDDDDDDDDDDD
  9161. @DDDDDDDDDDDDDDDDDDD$!
  9162. @DDDDDDDDDDDDDDDDDDD
  9163. @DDDDDDDDDDDDDDDDDDD
  9164. @DDDDDDDDDDDDDDDDDDD
  9165. @DDDDDDDDDDDDDDDDDDDD
  9166. DDDDDDDDDDDDDDDDDDDD
  9167. DDDDDDDDDDDDDDDDDDDD
  9168. !qwwwwwwwwwwwwwwwwww
  9169. DDDDDDDDDDDDDDDDDDDD
  9170. DDDDDDDDDDDDDDDDDDDD
  9171. DDDDDDDDDDDDDDDDDDDD
  9172. qwwww
  9173. wwwwww
  9174. wwwwww
  9175. wwwwww
  9176. wwwwww
  9177. """"""""""""
  9178. qwwq'07
  9179. +"""""""""""
  9180. wwwwww
  9181. """"""""""""
  9182. +"""""""""""
  9183. wwwwww
  9184. "'w"ww'rr"w"
  9185. +rr'rww"''r'
  9186. wwwwww
  9187. """"""""""""
  9188. +"""""""""""
  9189. wwwwww
  9190. ""'w'rww''w"
  9191. +"rrw"wwwrr'
  9192. wwwwww
  9193. """"""""""""
  9194. +"""""""""""
  9195. wwwwww
  9196. "'w'r"w'rw'"
  9197. +rrw"'rw"ww"
  9198. wwwwww
  9199. """"""""""""
  9200. +"""""""""""
  9201. wwwwww
  9202. "ww''r'w'"w"
  9203. +rwwr"wrw"r'
  9204. wwwwww
  9205. """"""""""""
  9206. +"""""""""""
  9207. wwwwww
  9208. DDDDDDDDDDDDDDDD
  9209. @DDDDDDDDDDDDDDDDDDDDDDDDDDD
  9210. DDDDDDDDDDDDDDDDDDDDDDDDDDD
  9211. @DDDDDDDDDDDDDDDDDDDDDDDDDDD
  9212. DDDDDDDDDDDDDDDDDDDDDDDDDDD
  9213. DDDDDDDDDDDDDDD
  9214. @DDDDDDDDDDDDDDDD
  9215. DDDDDDDDDDDDDDDDDDDDDDDDDDDD
  9216. !@DDDDDDDDDDDDDDDDDDDDDDDDDDD
  9217. DDDDDDDDDDDDDDDDDDDDDDDDDDDD!
  9218. @DDDDDDDDDDDDDDDDDDDDDDDDDDD
  9219. @DDDDDDDDDDDDDDD
  9220. qww33ww
  9221. ww73sww
  9222. 1'ru&'ruw
  9223. wwwww
  9224. r7"'r
  9225. wwwww
  9226. pwwwp
  9227. wwpwpp
  9228. qppppw
  9229. qwwwwwww
  9230. wwwwwwwwwww
  9231. wwwwwwwwwww
  9232. wwwwwww
  9233. wwwwwww
  9234. qwwwwww
  9235. DDDDDDDDDDDDDDDDDDDDDDDDD
  9236. @DDDDDDDDDDDDDDDDDDDDDDDDDDD$
  9237. @DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
  9238. DDDDDDDDDDDDDDDDDDDDDDDDDDDD
  9239. @DDDDDDDDDDDDDDDDDDDDDDDD$D
  9240. @DDDDDDDDDDDDDDDDDDDDDDDDD
  9241. DDDDDDDDDDDDDDDDDDDDDDDDDDDD
  9242. DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
  9243. !@DDDDDDDDDDDDDDDDDDDDDDDDDDDD
  9244. DDDDDDDDDDDDDDDDDDDDDDDDD
  9245. qw'rw
  9246. '""""r
  9247. q23333#
  9248. qwwwwww
  9249. '""""r
  9250. +"""""""""
  9251. '$$BBr
  9252. """"""""""
  9253. qwwwww
  9254. +"""""""""
  9255. +"""""""""
  9256. '$$BBr
  9257. """"""""""
  9258. wwwww
  9259. +r"''rww"w
  9260. +"""""""""
  9261. '$$BBr
  9262. r'rww"''r"
  9263. +"""""""""
  9264. +w"ww'rr"'
  9265. '$$BBr
  9266. """"""""""
  9267. +"rrww'rwr
  9268. +"""""""""
  9269. '$$BBr
  9270. rrw"wwwr""
  9271. +"""""""""
  9272. +'w'rww''"
  9273. '$$BBr
  9274. """"""""""
  9275. +rw'rw"'rw
  9276. +"""""""""
  9277. '$$BBr
  9278. rw"'rw"ww"
  9279. +"""""""""
  9280. +w'r"w'rw'
  9281. '$$BBr
  9282. """"""""""
  9283. +"""""""""
  9284. +"""""""""
  9285. '$$BBr
  9286. """"""""""
  9287. +"""""""""
  9288. '$$BBr
  9289. '""""r
  9290. A$!!!
  9291. qwwwwwwwwwww
  9292. wwwwww
  9293. qwwwwwwwwwww
  9294. DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD$
  9295. @DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
  9296. DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
  9297. @DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
  9298. DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
  9299. @DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
  9300. awww%'r
  9301. twG!Wwg!'
  9302. a%WwW
  9303. 1ww7Aww
  9304. !'ruw
  9305. !'raw&sw'
  9306. s$'!G
  9307. f3S717
  9308. !'r'1G
  9309. a63#!'r"F!G
  9310. A&'1&
  9311. vww7!
  9312. awwG!'r
  9313. BUg!7
  9314. 1''Qwww
  9315. 6Qwww
  9316. 1g3d!7
  9317. 1''Q633
  9318. r3g3dQ
  9319. 6Q633
  9320. A&2w"w#t#'
  9321. s%!v"w#t
  9322. a&b7d"s'a
  9323. f3CgA&2w"g"Vr
  9324. a%r'r7BG
  9325. vws&6vG!&
  9326. 1vw&!GvG
  9327. !vW6aw7gAg
  9328. !61wG&rdw
  9329.  DDDDDDDDDT
  9330. DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
  9331. @DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
  9332. DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
  9333. BUUUUUUUUUU
  9334. @DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
  9335. DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
  9336. @DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
  9337. qwwwwwwwwwwwwwwwwwwwwww
  9338. qwwwwwwwwwwwwwwwwwwwwww
  9339. wwwwwwwwwwwwwwwwwwwwww
  9340. !qwwwwwwwwwwwwwwwwwwwwww
  9341. p"""""""""""""""""""""r
  9342. q"""""""""""""""""""""r
  9343. '"""""""""""""""""""""
  9344. q"""""""""""""""""""""r
  9345. q"""""""""""""""""""""r
  9346. q"""""""""""""""""""""r
  9347. '"""""""""""""""""""""'
  9348. q"""""""""""""""""""""r
  9349. q"""""""""""""""""""""r
  9350. q"""""""""""""""""""""r!
  9351. '"""""""""""""""""""""
  9352. !q"""""""""""""""""""""r
  9353. q"""""""""""""""""""""r
  9354. q"""""""""""""""""""""r
  9355. '"""""""""""""""""""""
  9356. q"""""""""""""""""""""r
  9357. q"""""""""""""""""""""r
  9358. q"""""""""""""""""""""r
  9359. '"""""""""""""""""""""
  9360. q"""""""""""""""""""""r
  9361. q"""""""""""""""""""""r
  9362. q"""""""""""""""""""""r
  9363. '"""""""""""""""""""""'
  9364. q"""""""""""""""""""""r
  9365. rVueu
  9366. q"""""""""""""""""""""r
  9367. q"""""""""""""""""""""r
  9368. '"""""""""""""""""""""'
  9369. q"""""""""""""""""""""r
  9370. Q7!'s
  9371. q"""""""""""""""""""""r
  9372. q"""""""""""""""""""""r
  9373. '"""""""""""""""""""""'
  9374. !q"""""""""""""""""""""r!
  9375. rc'1&
  9376. q"""""""""""""""""""""r
  9377. q"""""""""""""""""""""r
  9378. '"""""""""""""""""""""
  9379. q"""""""""""""""""""""r
  9380. !'!Tu
  9381. q"""""""""""""""""""""r
  9382. q"""""""""""""""""""""r
  9383. '"""""""""""""""""""""'
  9384. r"""""""""""""""""""""r
  9385. !'s6C
  9386. q"""""""""""""""""""""r
  9387. q"""""""""""""""""""""r
  9388. '"""""""""""""""""""""
  9389. q"""""""""""""""""""""r
  9390. q"""""""""""""""""""""r!!q"""""""""""""""""""""r
  9391. '"""""""""""""""""""""
  9392. r"""""""""""""""""""""r
  9393. !'d"s'!'
  9394. Q67!7
  9395. q"""""""""""""""""""""r
  9396. q"""""""""""""""""""""r
  9397. '"""""""""""""""""""""
  9398. q"""""""""""""""""""""r
  9399. !&aw7g!&
  9400. q"""""""""""""""""""""r
  9401. q"""""""""""""""""""""r
  9402. '"""""""""""""""""""""
  9403. q"""""""""""""""""""""r
  9404. q"""""""""""""""""""""r
  9405. q"""""""""""""""""""""r
  9406. '"""""""""""""""""""""'
  9407. q"""""""""""""""""""""r
  9408. !q"""""""""""""""""""""r
  9409. q"""""""""""""""""""""r
  9410. '"""""""""""""""""""""
  9411. q"""""""""""""""""""""r
  9412. q"""""""""""""""""""""r
  9413. q"""""""""""""""""""""r
  9414. !'"""""""""""""""""""""
  9415. r"""""""""""""""""""""r
  9416. qwwwwwwwwwwwwwwwwwwwwww
  9417. !qwwwwwwwwwwwwwwwwwwwwww
  9418. wwwwwwwwwwwwwwwwwwwwww
  9419. qwwwwwwwwwwwwwwwwwwwwww
  9420. @DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
  9421. DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
  9422. wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
  9423.